Prepare AWS Aurora MySQL/AWS RDS MySQL for RDI
Enable CDC features in your source databases
Follow the steps in the sections below to prepare an AWS Aurora MySQL or AWS RDS MySQL database. database to work with RDI.
Select the steps for your database type.
Add an Aurora reader node
RDI requires that your Aurora MySQL database has at least one replica or reader node.
To add a reader node to an existing database, select Add reader from the Actions menu of the database and add a reader node.
You can also create one during database creation by selecting Create an Aurora Replica or Reader node in a different AZ (recommended for scaled availability) under Availability & durability > Multi-AZ deployment.
Create and apply parameter group
RDI requires some changes to database parameters. On AWS Aurora, you change these parameters via a parameter group.
-
In the Relational Database Service (RDS) console,navigate to Parameter groups > Create parameter group. Create a parameter group with the following settings:
Name Value Parameter group name Enter a suitable parameter group name, like rdi-mysql
Description (Optional) Enter a description for the parameter group Engine Type Choose Aurora MySQL. Parameter group family Choose aurora-mysql8.0. Type Select DB Parameter Group. Select Create to create the parameter group.
-
Navigate to Parameter groups in the console. Select the parameter group you have just created and then select Edit. Change the following parameters:
Name Value binlog_format
ROW
binlog_row_image
FULL
gtid_mode
ON
enforce_gtid_consistency
ON
Select Save Changes to apply the changes to the parameter group.
-
Go back to your target database on the RDS console, select Modify and then scroll down to Additional Configuration. Set the DB Cluster Parameter Group to the group you just created.
Select Save changes to apply the parameter group to the new database.
-
Reboot your database instance. See Rebooting a DB instance within an Aurora cluster for more information.
Create Debezium user
The Debezium connector needs a user account to connect to MySQL. This user must have appropriate permissions on all databases where you want Debezium to capture changes.
-
Connect to your database as an admin user and create a new user for the connector:
CREATE USER '<username>'@'%' IDENTIFIED BY '<password>';
Replace
<username>
and<password>
with a username and password for the new user.The
%
means that the user can connect from any client. If you want to restrict the user to connect only from the RDI host, replace%
with the IP address of the RDI host. -
Grant the user the necessary permissions:
GRANT SELECT, RELOAD, SHOW DATABASES, REPLICATION SLAVE, REPLICATION CLIENT, LOCK TABLES ON *.* TO '<username>'@'%';
Replace
<username>
with the username of the Debezium user.You can also grant SELECT permissions for specific tables only. The other permissions are global and cannot be restricted to specific tables.
GRANT RELOAD, SHOW DATABASES, REPLICATION SLAVE, REPLICATION CLIENT, LOCK TABLES ON *.* TO '<username>'@'%'; GRANT SELECT ON <database>.<table> TO '<username>'@'%';
-
Finalize the user's permissions:
FLUSH PRIVILEGES;