Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Bagian berikut membahas cara mengonfigurasi CDC untuk database Amazon Aurora MySQL.
Membuat grup parameter
Luncurkan Dasbor Amazon RDS Anda.
Di Navigation Drawer, klik Parameter Groups.
Klik Buat Grup Parameter. Halaman Create Parameter Group akan muncul.
Gunakan tabel berikut untuk mengisi kolom di halaman ini:
Kolom
Deskripsi
Kelompok parameter
Pilih keluarga yang cocok dengan database Anda.
Jenis
Pilih DB Cluster Parameter Group.
Nama grup
Berikan nama untuk grup parameter.
Deskripsi
Berikan deskripsi untuk grup parameter.
Klik Buat.
Pilih kotak centang di sebelah kiri grup parameter yang baru dibuat.
Di bagian Tindakan grup parameter, klik Edit.
Tetapkan nilai parameter berikut:
Untuk replikasi berbasis GTID:
Parameter
Nilai
binlog_format
ROW
log_bin_use_v1_row_events
1
read_only
0
net_read_timeout
3600
net_write_timeout
3600
wait_timeout
86400
expire-logs-days
7
binlog_row_image
FULL
max_allowed_packet
1G (nilai yang direkomendasikan)
log-replica-updates
1
enforce-gtid-consistency
ON
gtid_mode
ON
Anda hanya dapat menyetel parameter ini ke ON setelah Anda menyetel enforce-gtid-consistency ke ON. Secara umum, gtid_mode dapat memiliki nilai
berikut:
OFF
OFF_PERMISSIVE
ON_PERMISSIVE
ON
Anda hanya dapat mengubah nilai parameter gtid_mode satu
langkah dalam satu waktu. Misalnya, jika mode saat ini ditetapkan ke OFF,
lakukan hal berikut:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-12 UTC."],[[["\u003cp\u003eBefore setting up Change Data Capture (CDC) for an Amazon Aurora MySQL database, you must have an existing Aurora cluster and be connected to the Writer endpoint of your master database server.\u003c/p\u003e\n"],["\u003cp\u003eA new DB Cluster Parameter Group should be created via the Amazon RDS Dashboard, selecting the correct family and type, and defining a unique name and description for it.\u003c/p\u003e\n"],["\u003cp\u003eWithin the Parameter Group, certain values need to be adjusted like \u003ccode\u003ebinlog_format\u003c/code\u003e to \u003ccode\u003eROW\u003c/code\u003e for both GTID and binlog based replication, along with other specific settings that are recommended, before saving the changes.\u003c/p\u003e\n"],["\u003cp\u003eThe parameter group must be applied to your database instance via the Amazon RDS dashboard, with the backup retention period set to 7 days, and then applied immediately.\u003c/p\u003e\n"],["\u003cp\u003eTo ensure proper replication, the binary log retention period must be set to a minimum of 7 days (168 hours) using a MySQL command and a new user 'datastream' must be created with specific replication and execution privileges.\u003c/p\u003e\n"]]],[],null,["# Configure an Amazon Aurora MySQL database\n\nThe following sections cover how to configure CDC for an Amazon Aurora MySQL database.\n| Before configuring CDC for your Amazon Aurora MySQL database, make sure that you have an existing Aurora cluster and that you have connected to the Writer endpoint of your primary database server.\n\nCreate a parameter group\n------------------------\n\n1. Launch your Amazon RDS Dashboard.\n\n2. In the **Navigation Drawer** , click **Parameter Groups**.\n\n3. Click **Create Parameter Group** . The **Create Parameter Group** page appears.\n\n4. Use the following table to populate the fields of this page:\n\n5. Click **Create**.\n\n6. Select the checkbox to the left of your newly created parameter group.\n\n7. Under **Parameter group actions** , click **Edit**.\n\n8. Set the following parameter values:\n\n - For **GTID-based** replication:\n\n - For **binlog-based** replication:\n\n9. Click **Save Changes**.\n\nAssign the parameter group to the database instance\n---------------------------------------------------\n\n1. Launch your Amazon RDS Dashboard.\n\n2. In the **Navigation Drawer** , click **Databases**, and then select your database instance.\n\n3. From the **Instance Actions** menu, select **Modify** . The **Modify DB Instance** dialog appears.\n\n4. In the **Additional configuration** section, select the database cluster parameter group that you [created](#create-a-parameter-group-aurora).\n\n5. Set the **Backup retention period** to **7 days**.\n\n6. Click **Continue**.\n\n7. In the **Scheduling of Modifications** pane, select the **Apply immediately** option.\n\nSet the binary log retention period\n-----------------------------------\n\n1. Enter the following MySQL command:\n\n ```sql\n call mysql.rds_set_configuration('binlog retention hours', 168);\n ```\n | You're entering this command because you want to ensure proper replication by configuring your system to retain binary logs for a minimum of 7 days (or 168 hours).\n2. Restart your MySQL server so that the changes you made can take effect.\n\nCreate a Datastream user\n------------------------\n\n1. Create a Datastream user:\n\n ```sql\n CREATE USER 'datastream'@'%' IDENTIFIED BY '\u003cvar translate=\"no\"\u003eYOUR_PASSWORD\u003c/var\u003e';\n ```\n2. Grant the following privileges to them:\n\n ```sql\n GRANT REPLICATION SLAVE, SELECT, REPLICATION CLIENT ON *.* TO 'datastream'@'%';\n GRANT EXECUTE ON PROCEDURE mysql.rds_show_configuration TO 'datastream'@'%';\n FLUSH PRIVILEGES;\n ```\n\nWhat's next\n-----------\n\n- Learn more about how Datastream works with [MySQL sources](/datastream/docs/sources-mysql)."]]