This topic describes how to create a read-only PolarDB-X instance for a primary PolarDB-X instance.
Background information
The data nodes of a primary PolarDB-X instance use an X-Paxos-based architecture. This architecture implements a three-replica mechanism to ensure high availability. Learners are added to the data nodes of a read-only PolarDB-X instance to ensure physical resource isolation. Additionally, strong consistency in read-only queries is maintained based on Timestamp Oracle (TSO).
Precautions
A primary instance and its associated read-only instances must be deployed in the same region but can be deployed in different zones within that region.
A read-only PolarDB-X instance must be associated with a primary PolarDB-X instance. When you create a database in the primary instance, the database is automatically replicated to all associated read-only instances. Similarly, when you delete a database from the primary instance, the corresponding replicated database is also deleted from all associated read-only instances.
Procedure
Log on to the PolarDB-X console.
In the top navigation bar, select the region where the instance is deployed.
On the Instances page, click the PolarDB-X 2.0 tab.
Find the instance that you want to manage and click
In the Actions column of the instance, and then click Read-only Instance.You can also click the instance name to go to its Basic Information page. Find the Read-only Instances section on the right side of the page and then click Create Read-only Instance.
On the buy page, configure the parameters. The following table describes the parameters.
Parameter
Description
Product Type
Valid values: Subscription and Pay-as-you-go.
NoteIf you select the subscription type, you are charged for the resource usage of the instance when you purchase the instance.
If you select the pay-as-you-go type, you are charged for the resource usage of the instance on an hourly basis.
If you want to create a pay-as-you-go instance, make sure that your Alibaba Cloud account has a balance of at least USD 100.
Region
The region is the same as that of the primary instance.
Zone
Select a zone for the primary node.
Network Type
By default, the value is set to Virtual Private Cloud.
VPC
Select a VPC.
NoteIf you do not have an existing VPC, create one.
After a PolarDB-X read-only instance is created, you cannot change its VPC.
VSwitch
Select a vSwitch.
NoteIf you do not have an existing vSwitch, create one.
After a PolarDB-X read-only instance is created, you can change its vSwitch.
MySQL Version
The MySQL version is the same as that of the primary instance.
Series
The series is the same as that of the primary instance.
Instance Family
Valid values: General-purpose and Dedicated.
General-purpose: The instance shares idle computing resources such as CPUs with other instances on the same server. This enhances cost efficiency.
Dedicated: The instance does not share allocated compute resources such as CPUs with other instances on the same server. This improves the reliability and stability of the cluster.
CN Node Spec
Select the compute node specifications.
DN Node Spec
Select the data node specifications.
CN Nodes
The number of compute nodes for the read-only instance. By default, this value is the same as that of the primary instance.
DN Nodes
The number of data nodes for the read-only instance. By default, this value is the same as that of the primary instance.
Node Specification
The node specifications. This parameter is supported only for the Standard Edition series.
Storage Type
By default, the value is Local SSD-Custom.
NoteYou do not need to specify the storage space size for the instance. The system charges you based on the actual disk space you use on an hourly basis (any usage less than one hour is rounded up to a full hour).
Subscription Duration
The subscription duration of the instance.
NoteThis parameter is available only if you select the subscription instance type.
Quantity
The number of read-only instances that you want to purchase.
Click Buy Now.
On the Confirm Order page, read and agree to the terms of service and click Pay to complete the payment.
After the payment is complete, wait for 10 to 15 minutes for the service to be activated. Then, you can return to the Instances page of the console to view the newly created read-only instance.
References
In addition to regular read-only instances, PolarDB-X also supports adding read-only columnar instances, from which you can query Clustered Columnar Index (CCI) data. For more information, see Add a read-only columnar instance.