-
Notifications
You must be signed in to change notification settings - Fork 218
DOC-5339 RDI: Aurora/MySQL prep instructions #1706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
--- | ||
Title: Prepare AWS Aurora and MySQL for RDI | ||
alwaysopen: false | ||
categories: | ||
- docs | ||
- integrate | ||
- rs | ||
- rdi | ||
description: Prepare AWS Aurora/MySQL databases to work with RDI | ||
group: di | ||
linkTitle: Prepare AWS Aurora/MySQL | ||
summary: Redis Data Integration keeps Redis in sync with the primary database in near | ||
real time. | ||
type: integration | ||
weight: 6 | ||
--- | ||
|
||
Follow the steps in the sections below to prepare an | ||
[AWS Aurora MySQL](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_GettingStartedAurora.CreatingConnecting.Aurora.html) | ||
database to work with RDI. | ||
|
||
## 1. Create a parameter group | ||
|
||
In the [Relational Database Service (RDS) console](https://console.aws.amazon.com/rds/), | ||
navigate to **Parameter groups > Create parameter group**. You will see the panel shown | ||
below: | ||
|
||
{{<image filename="images/rdi/ingest/prepsrc/aurora-mysql/RDIAWSMySQLParamGroup.webp" alt="Create parameter group panel" >}} | ||
|
||
Enter the following information: | ||
|
||
| Name | Value | | ||
| :-- | :-- | | ||
| **Parameter group family** | `mysql<your-mysql-version>` | | ||
| **Group name** | `cdc_mysql_param_group` | | ||
| **Description** | A parameter group for configuring CDC | | ||
|
||
|
||
Select **Create** to create the parameter group. | ||
|
||
## 2. Edit the parameter group | ||
|
||
Navigate to **Parameter groups** in the console. Select the `cdc_mysql_param_group` | ||
group you have just created and then select **Edit** . In the panel that appears, | ||
set the `binlog_format` parameter to `ROW`: | ||
|
||
{{< image filename="images/rdi/ingest/prepsrc/aurora-mysql/SetBinlogFormat.webp" alt="Set binlog_format to ROW" >}} | ||
|
||
Then, set the `binlog_row_image` parameter to `FULL`: | ||
|
||
{{< image filename="images/rdi/ingest/prepsrc/aurora-mysql/SetBinlogRowImage.webp" alt="Set binlog_row_image to FULL" >}} | ||
|
||
Select **Save changes** to apply the changes. | ||
|
||
## 3. Set the `binlog` retention period | ||
|
||
A 10-day `binlog` retention period is recommended for RDI. You can check the current | ||
setting by running the following query in | ||
[MySQL Workbench](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ConnectToInstance.MySQLWorkbench.html): | ||
|
||
```sql | ||
mysql> call mysql.rds_show_configuration; | ||
+------------------------+-------+------------------------------------------------------------------------------------------------------+ | ||
| name | value | description | | ||
+------------------------+-------+------------------------------------------------------------------------------------------------------+ | ||
| binlog retention hours | NULL | binlog retention hours specifies the duration in hours before binary logs are automatically deleted. | | ||
+------------------------+-------+------------------------------------------------------------------------------------------------------+ | ||
1 row in set (0.06 sec) | ||
|
||
Query OK, 0 rows affected (0.06 sec) | ||
``` | ||
|
||
A value of `NULL` or zero, as in the example above, means that the log will be | ||
erased as soon as possible. You can set the retention period to 10 days by running | ||
the following query: | ||
|
||
```sql | ||
mysql> call mysql.rds_set_configuration('binlog retention hours', 240); | ||
Query OK, 0 rows affected (0.02 sec) | ||
``` | ||
|
||
## 4. Create a CDC user | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. from this point we can use the username and granst used by RDI mySQL There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The idea of this section is to create the user. We haven't created the user prior to this step? |
||
|
||
Use the commands below, with administrator privileges, to create a user with | ||
permissions for CDC: | ||
|
||
```sql | ||
CREATE USER 'cdc_user'@'%' IDENTIFIED BY 'password'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use the username we used with mySQL instructions There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above comment again. |
||
GRANT REPLICATION SLAVE, REPLICATION CLIENT, SELECT ON *.* TO 'cdc_user'@'%'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When I was setting up RDS MySQL with Signify we executed the following for their database: mysql> GRANT SELECT, RELOAD, SHOW DATABASES, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'mysqluser'@'%';
mysql> GRANT SUPER ON *.* TO 'mysqluser'@'%'; We'll need to double check the minimal grants needed. |
||
``` | ||
|
||
Finally, flush the privileges to apply the changes: | ||
|
||
```sql | ||
FLUSH PRIVILEGES; | ||
``` | ||
|
||
## 5. Setup is complete | ||
|
||
You have now completed the setup for using AWS Aurora/MySQL with RDI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aurora MySQL version 2.x is compatible with MySQL 5.7, while Aurora MySQL version 3.x is compatible with MySQL 8.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yaronp68 Thanks for the suggestions, but @cmilesb has informed me that he already has an Aurora MySQL prep guide as part of the RDI in the Cloud docs (see his link to the other PR above). If you're OK with what he's got in that other PR, then I should just close this one as a duplicate. Sorry for the confusion.