tencent cloud

Feedback

Managing the RO Group of Read-Only Instance

Last updated: 2022-06-27 11:54:37

    Overview

    TencentDB for MySQL allows you to create one or more read-only instances to form an RO group, which is suitable for read/write separation and one-source-multiple-replica application scenarios and capable of greatly enhancing the read load capacity of your database.

    An RO group is a set of read-only instances sharing the same private network address. You can set their weights to balance the traffic load, set the policy of removing delayed read-only instances, and perform other configurations. You can deploy an RO group as needed and send the corresponding read requests to read-only instances according to certain rules. In addition, you can implement disaster recovery by configuring multiple read-only instances in the same RO group.

    Prerequisites

    A source instance must be created first before a read-only instance can be created. For more information, see Creating MySQL Instance.

    Creating RO Group

    1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation column to enter the instance management page.
    2. Click Add Read-Only Instance in the Instance Architecture Diagram section on the Instance Details tab or click Create on the Read-Only Instance tab.
    3. On the displayed purchase page, specify the following read-only instance configurations, confirm that everything is correct, and click Buy Now.
    • Specify RO Group: Select Create RO group. If multiple instances are purchased at a time, all of them will be assigned to this new RO group, and their weights will be automatically assigned by the system by default.
    • RO Group Name: The group name doesn't have to be unique and can contain up to 60 letters, digits, hyphens, underscores, and dots.
    • Remove Delayed RO Instances: This option indicates whether to enable the removal policy. If a read-only instance is removed, its weight will be automatically set to 0.
      If a read-only instance is removed when its delay exceeds the threshold, it will become inactive, its weight will be automatically set to 0, and alarms will be sent (for more information on how to configure the read-only instance removal alarm and recipients, see Alarm Policies (Cloud Monitor)). The instance will be put back into the RO group when its delay falls below the threshold.
      No matter whether delayed read-only instance removal is enabled, a read-only instance that is removed due to instance failure will rejoin the RO group when it is repaired.
    • Delay Threshold: This sets a delay threshold for the read-only instance. When the threshold is exceeded, the instance will be removed from the RO group.
    • Least RO Instances: This is the minimum number of instances that should be retained in the RO group. When there are fewer instances in the RO group, even if an instance exceeds the delay threshold, it will not be removed.
    • Assign Read Weight: It is assigned by the system.
    • Billing Mode: Pay-as-you-go.
    • Region: It is the same as that of the source instance by default.
    • Database Version: It is the same as that of the source instance by default.
    • Engine: It is the same as that of the source instance by default.
    • Architecture: Single-node. Although the single-node architecture is cost-effective, there is a risk with single point of failure for a single read-only instance. We strongly recommend you purchase at least two read-only instances in the business RO group that requires high availability.
    • Data Replication Mode: Async replication.
    • AZ: If there are multiple AZs in the current region, you can select one as needed.
      Note:

      The network delay across AZs in the same region, in different regions, and in regions outside the Chinese mainland is around a few milliseconds, tens of milliseconds, and over 100 milliseconds respectively, so you should select an AZ carefully.

    • For other configuration items, see Creating MySQL Instance.
    1. Return to the instance list. The status of the created instance is Delivering. If the status changes to Running, the read-only instance has been successfully created.

    Configuring RO Group

    On the RO group configuration page, you can configure the basic information of the group, such as ID, name, delayed replication, replication delay, policy to remove delayed read-only instances, delay threshold, least read-only instances, and read weight.

    Note:

    • Read-only instances in an RO group can use different specifications, and their read traffic weights can be different as well.
    • Read-only instances in the same RO group can have different expiration times and billing modes.
    • Once enabled, delayed replication will take effect for all read-only instances in this RO group, but won't change their replication statuses.
    • The replication delay option will appear only after delayed replication is enabled.
    1. Log in to the TencentDB for MySQL console. In the instance list, click a source instance ID to enter the instance management page.
    2. On the instance management page, click the Read-Only Instance tab and click Configure in the RO Group column to enter the RO group configuration page.
    3. On the RO group configuration page, configure the RO group information and click OK.
      You can set delayed replication and select to replay by flashbacked position or global transaction identifier (GTID) during the delay to efficiently roll back data and fix failures.
      • Replication Delay: You can configure the time of delayed replication between a read-only instance and its source instance. The value range is 1–259200 seconds.
      • Remove Delayed RO Instances: This option indicates whether to enable the removal policy. If a read-only instance is removed when its delay exceeds the threshold, its weight will be set to 0 automatically, and alarms will be sent (for more information on how to configure the read-only instance removal alarm and recipients, see Alarm Policies (Cloud Monitor)).
      • Delay Threshold: This sets a delay threshold for the read-only instance. When the threshold is exceeded, the instance will be removed from the RO group.
      • Least RO Instances: This is the minimum number of instances that should be retained in the RO group. When there are fewer instances in the RO group, even if an instance exceeds the delay threshold, it will not be removed.
      • Assign Read Weight: The RO group allows for two types of weight assignment: system-assigned weights and custom weights. A number between 0 and 100 must be used as the weight value. The system automatically sets read weights for a two-node or three-node TencentDB for MySQL instance as shown below.
        Memory Specification (MB) 100020004000800012000160002400032000480006400096000128000244000488000
        Weight 11224488101214162650
    • Rebalance:
      • Modifying weight will only affect new loads if rebalancing is disabled. The operation has no impact on read-only instances accessed by existing persistent connections and does not cause momentary database disconnection.
      • If rebalancing is enabled, all connections to the database will be temporarily disconnected, and the loads of newly added connections will be balanced according to the set weights.

    Terminating RO Group

    Note:

    • RO groups cannot be deleted manually.
    • An RO group will be automatically deleted when the last read-only instance in it is eliminated.
    • Empty RO groups cannot be retained.
    1. Log in to the TencentDB for MySQL console. In the instance list, click a source instance ID to enter the instance management page.
    2. On the instance management page, click the Read-Only Instance tab and click Terminate/Return or Terminate/Return & Refund in the Operation column on the right.
    3. In the pop-up window, read and agree to the Termination Rules and click Terminate Now.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support