tencent cloud

Feedback

Creating Global Replication Group

Last updated: 2024-11-05 10:15:53
    TencentDB for Redis® allows you to create a replication group in the console and add master or read-only instances to it, so as to implement consistent data sync in a one-master or multi-master architecture within the replication group.

    Concepts

    Instance role: You need to assign different roles to instances in a replication group, including master instance and read-only instance.
    Master instance: It provides data read/write access and is used to write the business data.
    Read-only instance: It provides the data read-only access and is used for read-only data operations or disaster recovery.
    IP address: Each instance in a replication group has a separate IP address, which can be accessed independently.
    Master/Replica switch: Automatic failover can be performed between master and replica nodes in each instance. However, it is not supported between master and read-only instances.

    Version Description

    Global replication supports instances running on 4.0 Standard Architecture, 4.0 Cluster Architecture, 5.0 Standard Architecture, and 5.0 Cluster Architecture.
    The current version of the global replication feature supports only instances deployed in the same AZ. Multi-AZ instances will be supported in the future.

    Billing Details

    The instance syncs data from other instances in the replication group, no additional fees will be incurred.

    Creating Global Replication Group

    Prerequisites

    You have created a TencentDB for Redis® instance. For more information, see Creating TencentDB for Redis® Instance.
    The instance is in the Running status.

    Directions

    2. Select Global Replication on the left sidebar.
    3. On the Redis - Global Replication page on the right, click Create Replication Group.
    4. In the Create Replication Group pop-up window, configure the following parameters and click OK.
    Parameter
    Description
    Required
    Example
    Error Code
    Name of the replication group to be created. Enter a name as prompted.
    Yes
    test
    Remarks
    Brief description of the replication group. You can enter any characters to distinguish the group from others.
    No
    Replication group creation test
    Master instance region
    Select the region of the master instance in the replication group.
    Yes
    Guangzhou
    Select master instance
    Select the master instance in the replication group. The version, architecture, and memory capacity of the selected instance will be displayed, and you need to confirm whether the specification meets your requirements.
    Yes
    test-XXX
    Note:
    The Redis kernel of the master instance specified during replication group creation must be upgraded to the Global Replication Edition. After the upgrade is completed, one or multiple momentary disconnections lasting 5 seconds will occur.
    5. Return to the Redis - Global Replication page, and you can see the newly created replication group in the replication group list. Click
    
    before the name of the replication group to show its instance list, where you can view the status of the master instance. You can use the master instance after the system upgrades its kernel to the Global Replication edition.
    
    

    Adding Instance to Replication Group

    After creating a replication group, you can add instances in the same or different regions and assign master and read-only instance roles to the added instances as needed to implement data sync.

    Note

    An instance newly added to a replication group will sync data from the master instance node, and it cannot be manipulated or accessed before the full data is synced.
    Once an instance is added to a replication group, its kernel version will be upgraded, and momentary disconnections will occur after the upgrade.

    Prerequisites

    You have created a global replication group, and it is in Running status.
    You have created an instance to be added to the replication group. Its compatible Redis version and architecture must be the same as those of the master instance specified during replication group creation, its memory capacity must be greater than or equal to the used capacity of the master instance, and it must be in Running status.
    If you want to specify the instance to be added as a master instance, it must have at least two replica nodes.
    When you add the first instance to a replication group, you don't need to clear the data. When adding subsequent instances, be sure to clear the data.
    Note:
    The first instance added in the replication group has the following two scenarios:
    The master instance added to a newly created replication group
    The first instance added to an existing replication group after all instances in it are removed.

    Directions

    1. In the instance list on the Redis - Global Replication page, select the target replication group.
    2. In the Operation column of the replication group, click Add Instance.
    3. In the Add Instance pop-up window, read the notes, configure the following parameters, and click OK.
    Region: Select the region of the target instance.
    Select Instance: Select the target instance.
    Instance Role: Assign a role (master instance or read-only instance) to the target instance.
    Note:
    When there is no instance in the replication group, only the master instance can be added, and the read-only instance cannot be added.
    If there are instances in the replication group, you can choose to add a read-only instance. If you need to add a master instance, submit a ticket.
    4. Return to the Redis - Global Replication page. In the replication group list, click
    
    before the name of the target replication group to show its instance list, where you can see the newly added instance.
    
    You can add multiple instances to a replication group as needed and then sync data between them.

    Notes on Availability

    Cross-Region Disaster Recovery

    A master instance and a read-only instance can be added to a replication group to set up a cross-region disaster recovery system. However, the system will not automatically perform failover, which can only be manually performed in the console or through TencentCloud API. For detailed directions, see Switching Instance Role.

    Replication exceptions

    No matter whether a replication group has one or multiple master instances, when replication is interrupted, the system will not set them as read-only instances or perform other operations; instead, it will automatically resume the replay of incremental logs after instance recovery. To ensure data consistency, we recommend you configure alarms for replication exceptions and set master instances as read-only instances when a replication exception (such as replication interruption) occurs.

    Related APIs

    API
    Description
    Queries a replication group
    Switches with master instance in a replication group
    Modifies the role of an instance in a replication group
    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