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

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

# دليل إعداد RDS MariaDB كمصدر

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>;
};

يوضح هذا الدليل خطوة بخطوة كيفية إعداد مثيل RDS MariaDB لديك لنسخ بياناته عبر MySQL ClickPipe.

<br />

<Info>
  نوصي أيضًا بالاطلاع على الأسئلة الشائعة الخاصة بـ MySQL [هنا](/ar/integrations/clickpipes/mysql/faq). ويجري تحديث صفحة الأسئلة الشائعة باستمرار.
</Info>

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

السجل الثنائي هو مجموعة من ملفات السجل التي تحتوي على معلومات حول تعديلات البيانات التي أُجريت على مثيل خادم MySQL. وتُعد ملفات السجل الثنائي مطلوبة للنسخ المتماثل. يجب اتباع كلتا الخطوتين أدناه:

<Steps>
  <Step title="تمكين التسجيل الثنائي عبر النسخ الاحتياطي الآلي" id="enable-binlog-logging-rds">
    تحدد ميزة النسخ الاحتياطي الآلي ما إذا كان التسجيل الثنائي مفعّلًا أو معطّلًا في MySQL. ويمكن ضبط ذلك من خلال AWS Console:

    <Image img="https://mintcdn.com/private-7c7dfe99-trino-dialect/ZEyvJTCdFXKmprnu/images/integrations/data-ingestion/clickpipes/mysql/source/rds/rds-backups.webp?fit=max&auto=format&n=ZEyvJTCdFXKmprnu&q=85&s=91cd44fb04281d38ec0b63f6a11a5a6c" alt="تمكين النسخ الاحتياطي الآلي في RDS" size="lg" border width="3230" height="530" data-path="images/integrations/data-ingestion/clickpipes/mysql/source/rds/rds-backups.webp" />

    يُنصح بضبط فترة الاحتفاظ بالنسخ الاحتياطية على مدة طويلة بما يكفي، وفقًا لحالة استخدام النسخ المتماثل.
  </Step>

  <Step title="ساعات الاحتفاظ بـ binlog" id="binlog-retention-hours-rds">
    تستخدم Amazon RDS for MariaDB طريقة مختلفة لتحديد مدة الاحتفاظ بـ binlog، وهي مقدار الوقت الذي يُحتفَظ فيه بملف binlog الذي يحتوي على التغييرات. وإذا لم تُقرأ بعض التغييرات قبل إزالة ملف binlog، فلن يتمكن النسخ المتماثل من الاستمرار. القيمة الافتراضية لساعات الاحتفاظ بـ binlog هي NULL، ما يعني عدم الاحتفاظ بالسجلات الثنائية.

    لتحديد عدد الساعات للاحتفاظ بالسجلات الثنائية على مثيل قاعدة بيانات، استخدم الدالة mysql.rds\_set\_configuration مع فترة احتفاظ بـ binlog طويلة بما يكفي لحدوث النسخ المتماثل. ويُعد `24 hours` الحد الأدنى الموصى به.

    ```text theme={null}
    mysql=> call mysql.rds_set_configuration('binlog retention hours', 24);
    ```
  </Step>
</Steps>

<div id="binlog-parameter-group-rds">
  ## اضبط إعدادات binlog في مجموعة المعلمات
</div>

يمكنك العثور على مجموعة المعلمات بالنقر على مثيل MariaDB الخاص بك في RDS Console، ثم الانتقال إلى علامة التبويب `Configurations`.

<Image img="https://mintcdn.com/private-7c7dfe99-trino-dialect/zkBy8QRjLpx6BosZ/images/integrations/data-ingestion/clickpipes/mysql/parameter_group/rds_config.webp?fit=max&auto=format&n=zkBy8QRjLpx6BosZ&q=85&s=fea883549cd2426a9d14db24670c5ca5" alt="مكان العثور على مجموعة المعلمات في RDS" size="lg" border width="708" height="853" data-path="images/integrations/data-ingestion/clickpipes/mysql/parameter_group/rds_config.webp" />

عند النقر على رابط مجموعة المعلمات، ستنتقل إلى صفحة مجموعة المعلمات. وسترى زر `Edit` في أعلى اليمين:

<Image img="https://mintcdn.com/private-7c7dfe99-trino-dialect/zkBy8QRjLpx6BosZ/images/integrations/data-ingestion/clickpipes/mysql/parameter_group/edit_button.webp?fit=max&auto=format&n=zkBy8QRjLpx6BosZ&q=85&s=393ccec3725edf92a95cc15df8f00547" alt="تحرير مجموعة المعلمات" size="lg" border width="1662" height="292" data-path="images/integrations/data-ingestion/clickpipes/mysql/parameter_group/edit_button.webp" />

يجب ضبط الإعدادات `binlog_format` و`binlog_row_metadata` و`binlog_row_image` على النحو التالي:

1. اضبط `binlog_format` على `ROW`.

<Image img="https://mintcdn.com/private-7c7dfe99-trino-dialect/zkBy8QRjLpx6BosZ/images/integrations/data-ingestion/clickpipes/mysql/parameter_group/binlog_format.webp?fit=max&auto=format&n=zkBy8QRjLpx6BosZ&q=85&s=c35f70d6504e3ba1886bd74feb009248" 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-trino-dialect/zkBy8QRjLpx6BosZ/images/integrations/data-ingestion/clickpipes/mysql/parameter_group/binlog_row_metadata.webp?fit=max&auto=format&n=zkBy8QRjLpx6BosZ&q=85&s=74a543105efd5e6b42a12fab01d9c15e" alt="البيانات الوصفية لصف binlog إلى FULL" 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-trino-dialect/zkBy8QRjLpx6BosZ/images/integrations/data-ingestion/clickpipes/mysql/parameter_group/binlog_row_image.webp?fit=max&auto=format&n=zkBy8QRjLpx6BosZ&q=85&s=5a23b3c7c0e005345a59e49a0376d61b" alt="صورة صف binlog إلى FULL" size="lg" border width="934" height="234" data-path="images/integrations/data-ingestion/clickpipes/mysql/parameter_group/binlog_row_image.webp" />

بعد ذلك، انقر على `Save Changes` في أعلى اليمين. قد تحتاج إلى إعادة تشغيل المثيل حتى تدخل التغييرات حيز التنفيذ. إذا ظهر لك `Pending reboot` بجانب رابط مجموعة المعلمات في علامة التبويب `Configurations` الخاصة بمثيل RDS، فهذه علامة واضحة على ضرورة إعادة تشغيل المثيل.

<br />

<Tip>
  إذا كان لديك عنقود MariaDB، فستجد المعلمات المذكورة أعلاه في مجموعة معلمات [DB Cluster](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_WorkingWithParamGroups.CreatingCluster.html)، وليس في مجموعة مثيل DB.
</Tip>

<div id="gtid-mode-rds">
  ## تمكين وضع GTID
</div>

تُعدّ Global Transaction Identifiers ‏(GTIDs) معرّفات فريدة تُسنَد إلى كل معاملة مُعتمدة في MySQL/MariaDB. وهي تُبسّط النسخ المتماثل عبر binlog وتجعل استكشاف الأخطاء وإصلاحها أكثر سهولة. يفعّل MariaDB وضع GTID افتراضيًا، لذلك لا يلزم المستخدم اتخاذ أي إجراء لاستخدامه.

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

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

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

   ```sql theme={null}
   CREATE USER 'clickpipes_user'@'host' 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 authentication (اختياري)
</div>

<Note>
  [أطلقت AWS دعم IAM authentication لقاعدة البيانات في RDS for MariaDB في الإصدار 10.6.5](https://aws.amazon.com/blogs/database/iam-authentication-with-amazon-rds-for-mariadb/). يعتمد الدعم على إصدار المحرك المحدد وRegion في AWS. راجع [المناطق المدعومة حاليًا وإصدارات المحرك في AWS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RDS_Fea_Regions_DB-eng.Feature.IamDatabaseAuthentication.html) قبل استخدام هذا الخيار.
</Note>

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

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

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

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

<Image img="https://mintcdn.com/private-7c7dfe99-trino-dialect/ZEyvJTCdFXKmprnu/images/integrations/data-ingestion/clickpipes/mysql/source/rds/security-group-in-rds-mysql.webp?fit=max&auto=format&n=ZEyvJTCdFXKmprnu&q=85&s=ac44f969dafd1264c1f0f006477cc3b2" alt="أين تجد مجموعة الأمان في RDS؟" 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-trino-dialect/ZEyvJTCdFXKmprnu/images/integrations/data-ingestion/clickpipes/postgres/source/rds/edit_inbound_rules.webp?fit=max&auto=format&n=ZEyvJTCdFXKmprnu&q=85&s=7e5852a4a8a42c9a438075b917532273" alt="تعديل قواعد Inbound rules لمجموعة الأمان المذكورة أعلاه" 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>

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