The following sections cover how to configure CDC for an Amazon RDS for MySQL database.
Create a parameter group
- Launch your Amazon RDS Dashboard.
- In the Navigation Drawer, click Parameter Groups, and then click Create Parameter Group. The Create Parameter Group page appears.
- Select the database family that matches your database, provide a name and description for the parameter group, and then click Create.
- Select the checkbox to the left of your newly created parameter group, and then, under Parameter group actions, click Edit.
- Use the following table to set the parameters for your group.
Parameter Value binlog_format ROW
log_bin_use_v1_row_events 1
read_only 0
net_read_timeout 3600
net_write_timeout 3600
wait_timeout 86400
- Click Save Changes.
Create a read replica
- Launch your Amazon RDS Dashboard.
- In the Navigation Drawer, click Databases.
- Select the main database instance to which you want Datastream to connect.
- Expand the Actions button, and then click Create read replica.
- Configure the read replica, as necessary.
- Click Create read replica.
Configure the read replica (or source database)
- Launch your Amazon RDS Dashboard.
- In the Navigation Drawer, click Databases.
- Select the read replica that you created, and then click Modify.
- Go to the Additional configuration section.
- Select the parameter group that you created.
- Set the Backup retention period to 7 days.
- Click Continue.
- Under Scheduling of modifications, select Apply immediately.
Verify that the parameter group is assigned to the database instance
Launch your Amazon RDS Dashboard.
In the Navigation Drawer, click Databases, and then select your database instance.
Click the Configurations tab.
Verify that you see the parameter group that you created, and that its status is pending-reboot.
Reboot your database instance to complete the configuration. To reboot the instance:
- In the Navigation Drawer, click Instances.
- Select your database instance.
- From the Instance Actions menu, select Reboot.
Set the binary log retention period
Enter the following MySQL command:
call mysql.rds_set_configuration('binlog retention hours', 168);
Restart your MySQL server so that the changes you made can take effect.
Create a Datastream user
To create a Datastream user, enter the following MySQL commands:
CREATE USER 'datastream'@'%' IDENTIFIED BY 'YOUR_PASSWORD'; GRANT REPLICATION SLAVE, SELECT, REPLICATION CLIENT ON *.* TO 'datastream'@'%'; FLUSH PRIVILEGES;
What's next
- Learn more about how Datastream works with MySQL sources.