This topic describes how to create an ApsaraDB RDS for MySQL read-only instance. If the primary instance of your database system is overwhelmed by large amounts of read requests, you can create read-only instances to offload read requests from the primary instance and increase the throughput of your application. Each read-only instance is a replica of the primary instance. The primary instance replicates updates to its data to all read-only instances created in it.
For more information about how to create read-only instances in other database engines, see the following topics:
- Create an RDS SQL Server read-only instance
- Create an RDS PostgreSQL read-only instance
- Create an RDS PPAS read-only instance
For more information about read-only instances, see Overview of ApsaraDB RDS for MySQL read-only instances.
The instance runs one of the following MySQL versions and RDS editions:
- MySQL 8.0 in the High-availability Edition or Enterprise Edition
- MySQL 5.7 in the High-availability Edition or Enterprise Edition
- MySQL 5.6
- You can only create read-only instances in the primary instance. You cannot switch existing instances to read-only instances.
- While you create a read-only instance, the system replicates data from a secondary instance. Therefore, the operation of the primary instance is not interrupted.
- A read-only instance does not inherit the parameter settings of the primary instance. The system generates default parameter settings for it. You can only reconfigure the parameters of a read-only instance in the ApsaraDB for RDS console.
- The maximum number of read-only instances you can create in the primary instance varies
depending on the memory capacity.
Memory capacity Maximum number of read-only instances ≥ 64 GB 10 ＜ 64 GB 5
- Each read-only instance is charged at an hourly rate by pay-as-you-go billing. The hourly rate varies depending on the instance type at the time of deduction. For more information, visit ApsaraDB RDS for MySQL.
Create a read-only RDS instance
- Log on to the ApsaraDB for RDS console.
- In the upper-left corner of the page, select the region where the target RDS instance resides.
- Find the target RDS instance and click its ID.
- In the Distributed by Instance Role section of the Basic Information page, click Create Read-Only Instance.
- Configure the parameters of the read-only instance.
Parameter Description Zone The zone where the read-only instance resides. Each zone is an independent physical area located within a region. There are no substantive differences between zones in the same region. If your database system spans multiple zones, it can provide zone-level disaster recovery. Instance Type
Note Each instance type supports a specific number of CPU cores, memory capacity, maximum number of connections, and maximum input/output operations per second (IOPS). For more information, see Primary instance types.
- Entry-level: belongs to the general-purpose instance family. A general-purpose instance occupies exclusive memory and I/O resources allocated to it, but shares CPU and storage resources with the other general-purpose instances on the same physical host.
- Enterprise-level: belongs to the dedicated instance family. A dedicated instance occupies exclusive CPU, memory, storage, and I/O resources allocated to it. The top configuration of the dedicated instance family is dedicated host: A dedicated-host instance occupies all CPU, memory, storage, and I/O resources on the physical host where it is housed.
Capacity The storage capacity to store the data files, system files, binary log files, and transaction files of the read-only instance. You can adjust the storage capacity at increments of 5 GB.Note The dedicated instance family support exclusive allocations of resources. Therefore, the storage capacity of each instance type with local SSDs in this family is fixed and cannot be adjusted. For more information, see Primary instance types.
- Click Next: Instance Configuration and configure the following parameters.
Parameter Description Network Type
Note Make sure that the primary RDS instance and the ECS instance you want to connect have the same network type. If both their network types are VPC, you must also make sure that they reside in the same VPC. Otherwise, they cannot communicate over an internal network.
- Classic Network: a traditional type of network.
- VPC: A VPC is an isolated virtual network with higher security and better performance than a classic network. This is the recommended network type. If you select the VPC network type, you must also specify VPC and VSwitch of Primary Node.
- Click Next: Confirm Order.
- Read and select Terms of Service and click Pay Now.
The read-only instances are created after a few minutes.
View a read-only instance
To view a read-only instance on the Instances page, follow these steps:
- Log on to the ApsaradB for RDS console.
- Select the region where the read-only instance resides.
- Find the read-only instance and click its ID.
To view a read-only instance on the Basic Information page of its primary RDS instance, follow these steps:
- Log on to the ApsaradB for RDS console.
- Select the region where the primary RDS instance resides.
- Find the primary RDS instance and click its ID.
- On the Basic information page, move the pointer over the number of read-only instances and click the ID of the read-only instance you want to view.
View the delay of data replication to a read-only instance
A primary RDS instance replicates data to its read-only instances at a certain delay. You can navigate to the Basic Information page of a read-only instance to view the delay of data replication to it.
|CreateReadOnlyDBInstance||Creates a read-only instance for a primary ApsaraDB for RDS instance.|
- Will the system automatically upgrade the specifications of read-only instances after
I upgrade the specifications of their primary RDS instance?
No, you must manually upgrade the specifications of read-only instances.
- Can I access a read-only instance by using a read/write splitting address after I
set its read weight to 0?
No, you can only access a read-only instance by using its own internal or public endpoint after you set its read weight to 0. We recommend that you only set the read weight of a read-only instance to 0 if you want this instance to server only a specific service.