MySQL Amazon RDS Setup
This guide goes through the steps you need to take to create a MySQL resource using a MySQL database on Amazon RDS.
Requirements
- Configure Security Groups
- Configure Network ACLs (only if your database is within a VPC)
- Enable the Binary Log (only if using as an upstream resource)
Configure Security Groups
To allow access to your MySQL database from Meroxa IPs, follow these steps:
- Go to Amazon RDS in your AWS account.
- Go to Databases in the Amazon RDS menu.
- Click into the MySQL database you'd like to use with Meroxa.
- In the Connectivity & security section, under Security and VPC security groups, click your security group by clicking the blue hyperlink.
- You should now see a list of Security Groups, click into the selected security group by clicking the blue hyperlink under Security group ID.
- Under Inbound rules, click the Edit inbound rules button.
- Click the Add rule button.
- Set Protocol to
TCP
. - Set Port to the port of your database. For MySQL it's
3306
by default. - Set the Source to include the Meroxa IPs.
Configure Network ACLs
You only need to update this if your database is within a VPC.
To allow access to your MySQL database from Meroxa IPs, follow these steps:
- Go to Amazon RDS in your AWS account.
- Go to Databases in the Amazon RDS menu.
- Click into the MySQL database you'd like to create a replica of.
- In the Connectivity & security section, under Networking and VPC, click your VPC by clicking the blue hyperlink.
- You should now see a list of Your VPCs. Click into the selected VPC by clicking the blue hyperlink under VPC ID.
- In your VPC Details, click the blue hyperlink under Main network ACL.
- You should now see a list of Network ACLs. Click into the selected Network ACL by clicking the blue hyperlink under Network ACL ID.
- You will update both the Inbound and Outbound Rules of the Network ACL to contain
ALL - 0.0.0.0/0 - ALLOW
. - If your Inbound and Outbound Rules do not contain
ALL - 0.0.0.0/0 - ALLOW
—update the Source to allow Meroxa IPs both Inbound and Outbound.
Enable Binary Log
With Binary Log enabled, Meroxa pulls records from MySQL by reading the Binary Log, which produces change events for row-level INSERT
, UPDATE
, and `DELETE operations and emits those change events into a stream.
Backups must be enabled for Binary Loging to be enabled in RDS.
Using an existing parameter group
If you would like to enable the Binary Log using an existing parameter group, follow these steps:
- Go to Amazon RDS in your AWS account.
- Go to Databases in the Amazon RDS menu.
- Click into the MySQL database you'd like to use with Meroxa.
- In the Configuration section, under Instance and click the blue hyperlink under Parameter group.
- Click the Edit parameters button.
- Search and set the following key/values in your DB parameter group:
binlog_format
-ROW
binlog_row_image
-FULL
- Click the Save changes button.
Using a new parameter group
If you would like to enable the Binary Log using a new parameter group, follow these steps:
- Go to Amazon RDS in your AWS account.
- Go to Parameter groups in the Amazon RDS menu.
- Click the Create parameter group button.
- Set Parameter group family to the MySQL version of your database (e.g.,
mysql8.0
). - Set Type to
DB Parameter Group
. - Set Group name to an identifiable name.
- Click the Create button.
- You should now see a list of Parameter groups. Click into the parameter group you just created by clicking the blue hyperlink under Name.
- Click the Edit parameters button.
- Search and set the following key/values in your DB parameter group:
binlog_format
-ROW
binlog_row_image
-FULL
- Click the Save changes button.
- Go back to Databases in the Amazon RDS menu.
- Click into the MySQL database you'd like to use with Meroxa.
- Click the Modify button.
- Under the Additional configuration dropdown, look for DB parameter group and select your new parameter group.
- Click the Continue button.
- Under the Scheduling of modifications dialog, select Apply immediately.
- Click the Modify DB Instance button to confirm changes.
- Next, you must reboot the MySQL server and can do that by clicking on the Actions menu and clicking Reboot.
- You will be asked to confirm the reboot. Click the Confirm button.
- The Binary Log should now be enabled on your MySQL database.
What's Next?
Now that you've configured your MySQL Amazon RDS database instance, you are ready to create your MySQL resource!