This topic describes how to enable the cluster management function for an RDS SQL Server master instance. After this function is enabled, the system generates a read-only splitting address. You can configure the connection information of the master instance and the read-only splitting address in your application. The system distributes write requests to the master instance and read requests to the read-only address. The read-only splitting address then distributes the read requests to the read-only instances based on the specified read weights.
- The target RDS instance is a master instance.
- The used DB engine version and edition are SQL Server 2017 Cluster Edition.
- The target RDS instance has at least one read-only instance. For information about how to create a read-only instance, see Create an RDS SQL Server read-only instance.
- If it is the first time that you enable the read/write splitting function, the system automatically upgrades the backend administration systems of the master and read-only instances to the latest version to guarantee service availability. When the read/write splitting function is being enabled, the master instance is disconnected for 30 seconds or less. Additionally, the read-only instances is inaccessible during the whole restart process. We recommend that you enable the read/write splitting function during off-peak hours and make sure that your application can automatically reconnect to the RDS instance.
- If you have restarted or changed the specifications at least once for the master instance and its associated read-only instances after March 8, 2017, the backend administration systems of these instances have been automatically upgraded to the latest version. In such case, when you enable the read/write splitting function, the system does not restart the RDS instance or generate a transient disconnection.
- The generated read-only splitting address is fixed. It does not change even when you
enable and disable the cluster management function for multiple times. Therefore,
you do not need to change the configuration data on your application frequently. This
reduces maintenance costs.
Note The read-only splitting address cannot be changed manually.
- The cluster management function is free of charge. You pay only for the read-only instances you use.
- The cluster management function does not support classic networks.
- Log on to the RDS console.
- In the upper-left corner, select the region where the target RDS instance is located.
- Find the target RDS instance and click the instance ID.
- In the left-side navigation pane, click Cluster management.
- In the main workspace, click Enable now.
- Set the parameters shown in the following figure.
Parameter Description Network Type The type of the read/write splitting address.
- Intranet address
- If the network type of the master instance is VPC, then the network type of the read/write splitting address is also VPC.
- If the network type of the master instance is Classic Network, then the network type of the read/write splitting address is also Classic Network.
- Internet Address: used to access the RDS instance from the Internet. The Internet is prone to fluctuations. Therefore, we recommend that you use an internal endpoint to connect to the RDS instance.
Read Weight Distribution A higher read weight indicates more read requests to process. For example, the master instance has three read-only instances, and their read weights are 0, 100, 200, and 200, respectively. Then the master instance does not process read requests (write requests are still automatically sent to the master instance), and the three read-only instances process read requests at the 1:2:2 ratio.
Note You cannot specify a read weight for a read-only instance for which a replication latency is specified.
- Automatic Distribution: The system automatically assigns a read weight to each instance based on the instance specifications. After a read-only instance is created, it is automatically added to the read/write splitting link according to the read weight assigned by the system. For more information, see Rules of weight distribution by the system.
- Customized Distribution: You can manually set the read weight of each instance. The value ranges from 0 to 10000. After a read-only instance is created, its read weight is 0 by default. You must manually specify a read weight for the read-only instance.
- Intranet address
- Click OK.
What to do next
- You can add the connection information of the master instance and the read-only splitting address to the configuration data of your application. After you do so, the system distributes write requests to the master instance and read requests to the read-only splitting address. The read-only splitting address then distributes the read requests to the read-only instances based on the specified read weights.
- You can view the ID, running status, and read weight of each read-only instance. Additionally, you can click Manage in the Actions column for a read-only instance to manage the instance on the page for the instance.