Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion content/embeds/rdi-supported-source-versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
| PostgreSQL | 10, 11, 12, 13, 14, 15, 16 | 11, 12, 13, 14, 15, 16 | 15 |
| SQL Server | 2017, 2019, 2022 | 2016, 2017, 2019, 2022 | 2019 |
| AlloyDB for PostgreSQL | 14.2, 15.7 | - | 14.2, 15.7 |
| AWS Aurora/PostgreSQL | 15 | 15 | - |
| AWS Aurora/PostgreSQL | 15 | 15 | - |
| AWS Aurora/MySQL | - | - | - |
Copy link
Collaborator

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

Copy link
Contributor Author

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

@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.

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
Copy link
Collaborator

Choose a reason for hiding this comment

The 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

Copy link
Collaborator

Choose a reason for hiding this comment

The 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';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the username we used with mySQL instructions

Copy link
Collaborator

Choose a reason for hiding this comment

The 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'@'%';
Copy link
Collaborator

Choose a reason for hiding this comment

The 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.
Binary file not shown.
Binary file not shown.
Binary file not shown.