This topic describes how to change the network type of the read/write splitting address for an RDS MySQL instance. When you enable the read/write splitting function, you can use the internal or public endpoint of the master instance as the read/write splitting address.
If your application is deployed in the same VPC as the RDS instance, we recommend that you use the internal endpoint to guarantee data security and communication efficiency. If your application is deployed on your computer or in a different network from your RDS instance, you can use the public endpoint to establish a connection.
This topic applies only to RDS instances that run in shared proxy mode. For more information about RDS instances that run in dedicated proxy mode, see What are dedicated proxies.
Prerequisites
- The read/write splitting function is enabled. For more information, see Enable the read/write splitting feature for an ApsaraDB RDS for MySQL instance (shared proxy).
- The MySQL version and RDS edition are as follows:
- MySQL 5.7 High-availability Edition (with local SSDs)
- MySQL 5.6
Note The read/write splitting function is available in MySQL 8.0 only when the dedicated database proxy service is enabled. However, MySQL 8.0 supports only the VPC network type, therefore you cannot switch to the public endpoint.
Precautions
When you change the network type of the read/write splitting address, the master instance experiences a transient disconnection for up to 30 seconds. To avoid the impact of the transient disconnection, we recommend that you change the network type during off-peak hours and make sure that your application can automatically reconnect to the RDS instance.
Procedure
- Log on to the RDS console.
- Select the target region.
- Find the target RDS instance and click the instance ID.
- In the left-side navigation pane, click Database Connection or Database Proxy.
- Click the Read/Write Splitting tab.
- Click Switch to Internet Address or Switch to Inner Address.
- In the displayed dialog box, click Confirm.