> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-revert-104359-revert-104251-parquet-single.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> دليل خطوة بخطوة لإعداد Amazon Aurora MySQL كمصدر لـ ClickPipes

# دليل إعداد Aurora MySQL كمصدر

export const IAMAuthentication = ({engine, service, children}) => {
  const services = {
    aurora: {
      name: 'Aurora',
      resource: 'cluster',
      id: 'cluster-xxxxxxxxxxxxxx'
    },
    rds: {
      name: 'RDS',
      resource: 'instance',
      id: 'db-xxxxxxxxxxxxxx'
    }
  };
  const createUserStatements = {
    postgres: `CREATE USER clickpipes_iam_user;
GRANT rds_iam TO clickpipes_iam_user;`,
    mysql: `CREATE USER 'clickpipes_iam_user' IDENTIFIED WITH AWSAuthenticationPlugin AS 'RDS';`
  };
  const svc = services[String(service).toLowerCase()];
  const createUserSql = createUserStatements[String(engine).toLowerCase()];
  if (!svc) throw new Error(`Unsupported IAM authentication service: ${service}`);
  if (!createUserSql) throw new Error(`Unsupported IAM authentication engine: ${engine}`);
  return <>
      <p>
        Instead of a password, you can authenticate the ClickPipes user with an AWS IAM role. This lets ClickPipes connect to your Amazon {svc.name} {svc.resource} without storing database credentials.
      </p>

      <h4 id="enable-iam-authentication">Enable IAM authentication</h4>

      <ol>
        <li>Log in to your AWS account and go to the {svc.name} {svc.resource} you want to configure.</li>
        <li>Click <strong>Modify</strong>.</li>
        <li>Scroll to the <strong>Database authentication</strong> section.</li>
        <li>Select <strong>Password and IAM database authentication</strong>.</li>
        <li>Click <strong>Continue</strong>.</li>
        <li>Review the changes and select <strong>Apply immediately</strong>.</li>
      </ol>

      <h4 id="create-database-user">Create the ClickPipes user</h4>

      <p>Create the ClickPipes user with IAM authentication enabled, then grant it the same schema and replication privileges shown above:</p>

      <CodeBlock language="sql">{createUserSql}</CodeBlock>

      {children}

      <h4 id="obtaining-the-clickhouse-service-iam-role-arn">Obtain the ClickHouse service IAM role ARN</h4>

      <ol>
        <li>Log in to your ClickHouse Cloud account.</li>
        <li>Select the ClickHouse service you want to connect.</li>
        <li>Select the <strong>Settings</strong> tab.</li>
        <li>Scroll to the <strong>Network security information</strong> section at the bottom of the page.</li>
        <li>Copy the service's <strong>Service role ID (IAM)</strong> value, shown below.</li>
      </ol>

      <Frame>
        <img src="/images/cloud/security/secures3_arn.webp" alt="Service role ID (IAM) value in the Network security information section" />
      </Frame>

      <p>This value is your <code>{'{ClickHouse_IAM_ARN}'}</code> — the role ClickPipes uses to access your {svc.name} {svc.resource}.</p>

      <h4 id="obtaining-the-rds-resource-id">Obtain the resource ID</h4>

      <ol>
        <li>Log in to your AWS account and go to the {svc.name} {svc.resource} you want to configure.</li>
        <li>Select the <strong>Configuration</strong> tab.</li>
        <li>Note the <strong>Resource ID</strong> value — it looks like <code>{svc.id}</code>. This is your <code>{'{RDS_RESOURCE_ID}'}</code>, which you reference in the permissions policy.</li>
      </ol>

      <h4 id="manually-create-iam-role">Create the IAM role</h4>

      <ol>
        <li>Log in to your AWS account with an IAM user that has permission to create and manage IAM roles.</li>
        <li>Open the IAM console.</li>
        <li>
          Create a new IAM role with the following trust and permissions policies.

          <p>Trust policy (replace <code>{'{ClickHouse_IAM_ARN}'}</code> with the IAM role ARN of your ClickHouse instance):</p>

          <CodeBlock language="json">{`{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "{ClickHouse_IAM_ARN}"
      },
      "Action": [
        "sts:AssumeRole",
        "sts:TagSession"
      ]
    }
  ]
}`}</CodeBlock>

          <p>Permissions policy (replace <code>{'{RDS_RESOURCE_ID}'}</code> with the resource ID of your {svc.name} {svc.resource}, <code>{'{RDS_REGION}'}</code> with its region, and <code>{'{AWS_ACCOUNT}'}</code> with your AWS account ID):</p>

          <CodeBlock language="json">{`{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "rds-db:connect"
      ],
      "Resource": [
        "arn:aws:rds-db:{RDS_REGION}:{AWS_ACCOUNT}:dbuser:{RDS_RESOURCE_ID}/clickpipes_iam_user"
      ]
    }
  ]
}`}</CodeBlock>
        </li>
        <li>Once the role is created, copy its ARN. This is your <code>{'{RDS_ACCESS_IAM_ROLE_ARN}'}</code>.</li>
      </ol>

      <p>You can now use this IAM role to authenticate with your {svc.name} {svc.resource} from ClickPipes.</p>
    </>;
};

export const Image = ({img, alt, size = "lg"}) => {
  const normalizedSize = ["sm", "md", "lg"].includes(size) ? size : "lg";
  return <div className={`ch-image-${normalizedSize}`}>
      <Frame>
        <img src={img} alt={alt} />
      </Frame>
    </div>;
};

يوضح هذا الدليل خطوة بخطوة كيفية إعداد Amazon Aurora MySQL لنسخ البيانات إلى ClickHouse Cloud باستخدام [MySQL ClickPipe](/ar/integrations/clickpipes/mysql/index). للاطلاع على الأسئلة الشائعة حول MySQL CDC، راجع [صفحة الأسئلة الشائعة لـ MySQL](/ar/integrations/clickpipes/mysql/faq).

<div id="enable-binlog-retention-aurora">
  ## تمكين الاحتفاظ بالسجل الثنائي
</div>

السجل الثنائي عبارة عن مجموعة من ملفات السجل التي تحتوي على معلومات عن تعديلات البيانات التي أُجريت على مثيل خادم MySQL، وتُعد ملفات السجل الثنائي مطلوبة للنسخ المتماثل. لتهيئة الاحتفاظ بالسجل الثنائي في Aurora MySQL، يجب [تمكين التسجيل الثنائي](#enable-binlog-logging) و[زيادة فترة الاحتفاظ بالـ binlog](#binlog-retention-interval).

<Steps>
  <Step title="تمكين التسجيل الثنائي عبر النسخ الاحتياطي التلقائي" id="enable-binlog-logging">
    تُحدد ميزة النسخ الاحتياطية التلقائية ما إذا كان التسجيل الثنائي مُمكّنًا أو معطّلًا في MySQL. يمكن تهيئة النسخ الاحتياطية التلقائية لمثيلك في RDS Console بالانتقال إلى **Modify** > **Additional configuration** > **Backup** وتحديد مربع الاختيار **Enable automated backups** (إذا لم يكن محددًا بالفعل).

    <Image img="https://mintcdn.com/private-7c7dfe99-revert-104359-revert-104251-parquet-single/4ZDv2f4M_2GbJ9Bg/images/integrations/data-ingestion/clickpipes/mysql/source/rds/rds-backups.webp?fit=max&auto=format&n=4ZDv2f4M_2GbJ9Bg&q=85&s=20b0b92648d5b02b969ed6dbc85b0e17" alt="تمكين النسخ الاحتياطية التلقائية في Aurora" size="lg" border width="3230" height="530" data-path="images/integrations/data-ingestion/clickpipes/mysql/source/rds/rds-backups.webp" />

    نوصي بتعيين **Backup retention period** إلى قيمة طويلة بشكل معقول، بحسب حالة استخدام النسخ المتماثل.
  </Step>

  <Step title="Increase the binlog retention interval" id="binlog-retention-interval">
    <Warning>
      إذا حاولت ClickPipes استئناف النسخ المتماثل وكانت ملفات binlog المطلوبة قد حُذفت بسبب قيمة الاحتفاظ بالـ binlog المُعَدّة، فسينتقل ClickPipe إلى حالة خطأ وستلزم إعادة المزامنة.
    </Warning>

    بشكل افتراضي، يحذف Aurora MySQL السجل الثنائي بأسرع وقت ممكن (أي *الحذف المؤجل*). نوصي بزيادة فترة الاحتفاظ بالـ binlog إلى **72 ساعة** على الأقل لضمان توفر ملفات السجل الثنائي للنسخ المتماثل في سيناريوهات الفشل. لتعيين فترة احتفاظ للسجل الثنائي ([`binlog retention hours`](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/mysql-stored-proc-configuring.html#mysql_rds_set_configuration-usage-notes.binlog-retention-hours))، استخدم الإجراء [`mysql.rds_set_configuration`](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/mysql-stored-proc-configuring.html#mysql_rds_set_configuration):

    [//]: # "ملاحظة: يوصي معظم موفري CDC باستخدام الحد الأقصى لفترة الاحتفاظ في Aurora RDS (7 أيام/168 ساعة). ونظرًا لأن ذلك يؤثر في استخدام القرص، فإننا نوصي، من باب التحفظ، بحد أدنى قدره 3 أيام/72 ساعة."

    ```text theme={null}
    mysql=> call mysql.rds_set_configuration('binlog retention hours', 72);
    ```

    إذا لم يتم تعيين هذا الإعداد، أو تم تعيينه على فترة زمنية قصيرة، فقد يؤدي ذلك إلى حدوث فجوات في سجلات MySQL الثنائية، مما يعيق قدرة ClickPipes على استئناف النسخ المتماثل.
  </Step>
</Steps>

<div id="binlog-settings">
  ## تكوين إعدادات binlog
</div>

يمكن العثور على مجموعة المعلمات عند النقر على مثيل MySQL الخاص بك في RDS Console، ثم الانتقال إلى علامة التبويب **Configuration**.

<Tip>
  إذا كان لديك cluster لـ MySQL، فيمكن العثور على المعلمات أدناه في مجموعة معلمات [DB cluster](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_WorkingWithParamGroups.CreatingCluster.html) بدلًا من مجموعة معلمات DB instance.
</Tip>

<Image img="https://mintcdn.com/private-7c7dfe99-revert-104359-revert-104251-parquet-single/4ZDv2f4M_2GbJ9Bg/images/integrations/data-ingestion/clickpipes/mysql/parameter_group/aurora_config.webp?fit=max&auto=format&n=4ZDv2f4M_2GbJ9Bg&q=85&s=bf2f892ab56767433bf7c63fd87a31f8" alt="مكان العثور على مجموعة المعلمات في Aurora" size="lg" border width="1524" height="901" data-path="images/integrations/data-ingestion/clickpipes/mysql/parameter_group/aurora_config.webp" />

<br />

انقر على رابط مجموعة المعلمات، وسيأخذك ذلك إلى صفحتها المخصصة. ينبغي أن ترى زر **Edit** في أعلى اليمين.

<Image img="https://mintcdn.com/private-7c7dfe99-revert-104359-revert-104251-parquet-single/4ZDv2f4M_2GbJ9Bg/images/integrations/data-ingestion/clickpipes/mysql/parameter_group/edit_button.webp?fit=max&auto=format&n=4ZDv2f4M_2GbJ9Bg&q=85&s=56dd2c8547d89b8f8b484788dcc8afce" alt="تحرير مجموعة المعلمات" size="lg" border width="1662" height="292" data-path="images/integrations/data-ingestion/clickpipes/mysql/parameter_group/edit_button.webp" />

<br />

يجب ضبط المعلمات التالية كما يلي:

1. تعيين `binlog_format` إلى `ROW`.

<Image img="https://mintcdn.com/private-7c7dfe99-revert-104359-revert-104251-parquet-single/4ZDv2f4M_2GbJ9Bg/images/integrations/data-ingestion/clickpipes/mysql/parameter_group/binlog_format.webp?fit=max&auto=format&n=4ZDv2f4M_2GbJ9Bg&q=85&s=6e04eaf8367baea37adf3646eed9f2c0" alt="تنسيق binlog إلى ROW" size="lg" border width="960" height="232" data-path="images/integrations/data-ingestion/clickpipes/mysql/parameter_group/binlog_format.webp" />

2. تعيين `binlog_row_metadata` إلى `FULL`.

<Image img="https://mintcdn.com/private-7c7dfe99-revert-104359-revert-104251-parquet-single/4ZDv2f4M_2GbJ9Bg/images/integrations/data-ingestion/clickpipes/mysql/parameter_group/binlog_row_metadata.webp?fit=max&auto=format&n=4ZDv2f4M_2GbJ9Bg&q=85&s=d386fba4441470da3e99db913b7590f1" alt="البيانات الوصفية لصف binlog" size="lg" border width="934" height="234" data-path="images/integrations/data-ingestion/clickpipes/mysql/parameter_group/binlog_row_metadata.webp" />

3. تعيين `binlog_row_image` إلى `FULL`.

<Image img="https://mintcdn.com/private-7c7dfe99-revert-104359-revert-104251-parquet-single/4ZDv2f4M_2GbJ9Bg/images/integrations/data-ingestion/clickpipes/mysql/parameter_group/binlog_row_image.webp?fit=max&auto=format&n=4ZDv2f4M_2GbJ9Bg&q=85&s=575ce2aa831b497570fa71031e739487" alt="صورة صف binlog" size="lg" border width="934" height="234" data-path="images/integrations/data-ingestion/clickpipes/mysql/parameter_group/binlog_row_image.webp" />

<br />

بعد ذلك، انقر على **Save Changes** في الزاوية العلوية اليمنى. قد تحتاج إلى إعادة تشغيل المثيل الخاص بك حتى تدخل التغييرات حيز التنفيذ — ويمكنك معرفة ذلك إذا رأيت `Pending reboot` بجانب رابط مجموعة المعلمات في علامة التبويب **Configuration** الخاصة بمثيل Aurora.

<div id="gtid-mode">
  ## فعِّل وضع GTID (مُستحسن)
</div>

<Tip>
  يدعم MySQL ClickPipe أيضًا النسخ المتماثل دون وضع GTID. ومع ذلك، يُوصى بتمكين وضع GTID لتحسين الأداء وتسهيل استكشاف الأخطاء وإصلاحها.
</Tip>

تُعد [Global Transaction Identifiers (GTIDs)](https://dev.mysql.com/doc/refman/8.0/en/replication-gtids.html) معرّفات فريدة تُسنَد إلى كل معاملة تم تثبيتها في MySQL. وهي تُبسّط النسخ المتماثل لـ binlog وتجعل استكشاف الأخطاء وإصلاحها أكثر سهولة. **نوصي** بتمكين وضع GTID، بحيث يتمكن MySQL ClickPipe من استخدام النسخ المتماثل المستند إلى GTID.

النسخ المتماثل المستند إلى GTID مدعوم في Amazon Aurora MySQL v2 ‏(MySQL 5.7) وv3 ‏(MySQL 8.0)، وكذلك Aurora Serverless v2. لتمكين وضع GTID لمثيل Aurora MySQL الخاص بك، اتبع الخطوات التالية:

1. في RDS Console، انقر على مثيل MySQL الخاص بك.
2. انقر على علامة التبويب **Configuration**.
3. انقر على رابط مجموعة المعلمات.
4. انقر على زر **Edit** في الزاوية العلوية اليمنى.
5. اضبط `enforce_gtid_consistency` على `ON`.
6. اضبط `gtid-mode` على `ON`.
7. انقر على **Save Changes** في الزاوية العلوية اليمنى.
8. أعد تشغيل المثيل لتصبح التغييرات سارية المفعول.

<Image img="https://mintcdn.com/private-7c7dfe99-revert-104359-revert-104251-parquet-single/4ZDv2f4M_2GbJ9Bg/images/integrations/data-ingestion/clickpipes/mysql/enable_gtid.webp?fit=max&auto=format&n=4ZDv2f4M_2GbJ9Bg&q=85&s=c5c0a8fbdf44ed38c08bbc6d40b3fef8" alt="تم تمكين GTID" size="lg" border width="1650" height="469" data-path="images/integrations/data-ingestion/clickpipes/mysql/enable_gtid.webp" />

<div id="configure-database-user">
  ## تهيئة مستخدم قاعدة بيانات
</div>

اتصل بمثيل Aurora MySQL الخاص بك باستخدام مستخدم مسؤول، ثم نفّذ الأوامر التالية:

1. أنشئ مستخدمًا مخصصًا لـ ClickPipes:

   ```sql theme={null}
   CREATE USER 'clickpipes_user'@'%' IDENTIFIED BY 'some-password';
   ```

2. امنح أذونات المخطط. يوضّح المثال التالي أذونات قاعدة البيانات `mysql`. كرر هذه الأوامر لكل قاعدة بيانات ولكل مضيف تريد النسخ المتماثل منه:

   ```sql theme={null}
   GRANT SELECT ON `mysql`.* TO 'clickpipes_user'@'host';
   ```

3. امنح المستخدم أذونات النسخ المتماثل:

   ```sql theme={null}
   GRANT REPLICATION CLIENT ON *.* TO 'clickpipes_user'@'%';
   GRANT REPLICATION SLAVE ON *.* TO 'clickpipes_user'@'%';
   ```

<div id="iam-authentication">
  ### استخدام مصادقة IAM (اختياري)
</div>

<IAMAuthentication engine="mysql" service="aurora" />

<div id="configure-network-access">
  ## إعداد الوصول إلى الشبكة
</div>

<div id="ip-based-access-control">
  ### التحكم في الوصول المستند إلى عنوان IP
</div>

لتقييد حركة المرور الواردة إلى مثيل Aurora MySQL لديك، أضِف [عناوين IP الثابتة لـ NAT المذكورة في الوثائق](/ar/integrations/clickpipes/networking/static-ips) إلى **قواعد الدخول** في مجموعة الأمان الخاصة بـ Aurora.

<Image img="https://mintcdn.com/private-7c7dfe99-revert-104359-revert-104251-parquet-single/4ZDv2f4M_2GbJ9Bg/images/integrations/data-ingestion/clickpipes/mysql/source/rds/security-group-in-rds-mysql.webp?fit=max&auto=format&n=4ZDv2f4M_2GbJ9Bg&q=85&s=0ee7eea2b487aec6a24ee9148e6985d6" alt="أين تجد مجموعة الأمان في Aurora MySQL؟" size="lg" border width="2850" height="994" data-path="images/integrations/data-ingestion/clickpipes/mysql/source/rds/security-group-in-rds-mysql.webp" />

<Image img="https://mintcdn.com/private-7c7dfe99-revert-104359-revert-104251-parquet-single/ICsmB-Qg9LaQwDEB/images/integrations/data-ingestion/clickpipes/postgres/source/rds/edit_inbound_rules.webp?fit=max&auto=format&n=ICsmB-Qg9LaQwDEB&q=85&s=4734c2f05d130a091c679bf50a0685b1" alt="تحرير قواعد الدخول لمجموعة الأمان المذكورة أعلاه" size="lg" border width="1800" height="935" data-path="images/integrations/data-ingestion/clickpipes/postgres/source/rds/edit_inbound_rules.webp" />

<div id="private-access-via-aws-privatelink">
  ### الوصول الخاص عبر AWS PrivateLink
</div>

للاتصال بمثيل Aurora MySQL الخاص بك عبر شبكة خاصة، يمكنك استخدام AWS PrivateLink. اتبع [دليل إعداد AWS PrivateLink لـ ClickPipes](/ar/resources/support-center/knowledge-base/cloud-services/aws-privatelink-setup-for-clickpipes) لإعداد الاتصال.

<div id="whats-next">
  ## ما الخطوة التالية؟
</div>

الآن بعد تهيئة مثيل Amazon Aurora MySQL لديك لإجراء النسخ المتماثل عبر `binlog` والاتصال الآمن بـ ClickHouse Cloud، يمكنك [إنشاء أول MySQL ClickPipe لديك](/ar/integrations/clickpipes/mysql/index#create-your-clickpipe). وللاطلاع على الأسئلة الشائعة حول MySQL CDC، راجع [صفحة الأسئلة الشائعة الخاصة بـ MySQL](/ar/integrations/clickpipes/mysql/faq).
