RO Group of Read-Only Instances

Last updated: 2021-08-19 17:01:30

    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 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, please see Purchase Guide.
    • Before use, a TencentDB for MySQL instance needs to be initialized. For more information, please see Initializing TencentDB for MySQL Instance.

    Directions

    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. On the instance details page, click Add Read-Only Instance in Instance Architecture Diagram or click Create on the read-only instance page to enter the purchase page.
    3. Select the desired read-only instance configuration on the purchase page. After confirming that everything is correct, 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 RO group name doesn't need 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, please 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: set 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: read-only instances are pay-as-you-go.
    4. 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 name, removal policy, delay threshold, least RO instances, and read weight.

    Note:

    • Read-Only instances in an RO group can use different specifications, and their read traffic weights can be set.
    • Read-Only instances in the same RO group can have different expiration dates and billing modes.
    1. Log in to the TencentDB for MySQL console. In the instance list, click a source instance name 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.
      • 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, alarms will be sent (for more information on how to configure the read-only instance removal alarm and recipients, please see Alarm Policies (Cloud Monitor)).
      • Delay Threshold: set 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 supports two weight assignment methods: automatic assignment by the system and custom assignment. The weight value must be an integer between 0 and 100. Below is the list of read weights automatically set for two-node and three-node TencentDB for MySQL instances by the system:
        Instance SpecificationWeight
        1,000 MB memory1
        2,000 MB memory1
        4,000 MB memory2
        8,000 MB memory2
        12,000 MB memory4
        16,000 MB memory4
        24,000 MB memory8
        32,000 MB memory8
        48,000 MB memory10
        64,000 MB memory12
        96,000 MB memory14
        128,000 MB memory16
        244,000 MB memory26
        488,000 MB memory50
      • Rebalance:
        • If rebalance is disabled, modifying weight will take effect only for new loads but will not affect the read-only instances accessed by existing persistent connections or cause a momentary disconnection from the database.
        • If rebalance is enabled, a momentary disconnection will occur to disconnect all connections from the database, and the loads of newly added connections will be balanced according to the set weights.

    Terminating and deleting RO group

    • 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.