|
| 1 | +--- |
| 2 | +Title: Prepare AWS Aurora and MySQL for RDI |
| 3 | +alwaysopen: false |
| 4 | +categories: |
| 5 | +- docs |
| 6 | +- integrate |
| 7 | +- rs |
| 8 | +- rdi |
| 9 | +description: Prepare AWS Aurora/MySQL databases to work with RDI |
| 10 | +group: di |
| 11 | +linkTitle: Prepare AWS Aurora/MySQL |
| 12 | +summary: Redis Data Integration keeps Redis in sync with the primary database in near |
| 13 | + real time. |
| 14 | +type: integration |
| 15 | +weight: 6 |
| 16 | +--- |
| 17 | + |
| 18 | +Follow the steps in the sections below to prepare an |
| 19 | +[AWS Aurora MySQL](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_GettingStartedAurora.CreatingConnecting.Aurora.html) |
| 20 | +database to work with RDI. |
| 21 | + |
| 22 | +## 1. Create a parameter group |
| 23 | + |
| 24 | +In the [Relational Database Service (RDS) console](https://console.aws.amazon.com/rds/), |
| 25 | +navigate to **Parameter groups > Create parameter group**. You will see the panel shown |
| 26 | +below: |
| 27 | + |
| 28 | +{{<image filename="images/rdi/ingest/prepsrc/aurora-mysql/RDIAWSMySQLParamGroup.webp" alt="Create parameter group panel" >}} |
| 29 | + |
| 30 | +Enter the following information: |
| 31 | + |
| 32 | +| Name | Value | |
| 33 | +| :-- | :-- | |
| 34 | +| **Parameter group family** | `mysql<your-mysql-version>` | |
| 35 | +| **Group name** | `cdc_mysql_param_group` | |
| 36 | +| **Description** | A parameter group for configuring CDC | |
| 37 | + |
| 38 | + |
| 39 | +Select **Create** to create the parameter group. |
| 40 | + |
| 41 | +## 2. Edit the parameter group |
| 42 | + |
| 43 | +Navigate to **Parameter groups** in the console. Select the `cdc_mysql_param_group` |
| 44 | +group you have just created and then select **Edit** . In the panel that appears, |
| 45 | +set the `binlog_format` parameter to `ROW`: |
| 46 | + |
| 47 | +{{< image filename="images/rdi/ingest/prepsrc/aurora-mysql/SetBinlogFormat.webp" alt="Set binlog_format to ROW" >}} |
| 48 | + |
| 49 | +Then, set the `binlog_row_image` parameter to `FULL`: |
| 50 | + |
| 51 | +{{< image filename="images/rdi/ingest/prepsrc/aurora-mysql/SetBinlogRowImage.webp" alt="Set binlog_row_image to FULL" >}} |
| 52 | + |
| 53 | +Select **Save changes** to apply the changes. |
| 54 | + |
| 55 | +## 3. Set the `binlog` retention period |
| 56 | + |
| 57 | +A 10-day `binlog` retention period is recommended for RDI. You can check the current |
| 58 | +setting by running the following query in |
| 59 | +[MySQL Workbench](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ConnectToInstance.MySQLWorkbench.html): |
| 60 | + |
| 61 | +```sql |
| 62 | +mysql> call mysql.rds_show_configuration; |
| 63 | ++------------------------+-------+------------------------------------------------------------------------------------------------------+ |
| 64 | +| name | value | description | |
| 65 | ++------------------------+-------+------------------------------------------------------------------------------------------------------+ |
| 66 | +| binlog retention hours | NULL | binlog retention hours specifies the duration in hours before binary logs are automatically deleted. | |
| 67 | ++------------------------+-------+------------------------------------------------------------------------------------------------------+ |
| 68 | +1 row in set (0.06 sec) |
| 69 | + |
| 70 | +Query OK, 0 rows affected (0.06 sec) |
| 71 | +``` |
| 72 | + |
| 73 | +A value of `NULL` or zero, as in the example above, means that the log will be |
| 74 | +erased as soon as possible. You can set the retention period to 10 days by running |
| 75 | +the following query: |
| 76 | + |
| 77 | +```sql |
| 78 | +mysql> call mysql.rds_set_configuration('binlog retention hours', 240); |
| 79 | +Query OK, 0 rows affected (0.02 sec) |
| 80 | +``` |
| 81 | + |
| 82 | +## 4. Create a CDC user |
| 83 | + |
| 84 | +Use the commands below, with administrator privileges, to create a user with |
| 85 | +permissions for CDC: |
| 86 | + |
| 87 | +```sql |
| 88 | +CREATE USER 'cdc_user'@'%' IDENTIFIED BY 'password'; |
| 89 | +GRANT REPLICATION SLAVE, REPLICATION CLIENT, SELECT ON *.* TO 'cdc_user'@'%'; |
| 90 | +``` |
| 91 | + |
| 92 | +Finally, flush the privileges to apply the changes: |
| 93 | + |
| 94 | +```sql |
| 95 | +FLUSH PRIVILEGES; |
| 96 | +``` |
| 97 | + |
| 98 | +## 5. Setup is complete |
| 99 | + |
| 100 | +You have now completed the setup for using AWS Aurora/MySQL with RDI. |
0 commit comments