Scale down deployment

2025-10-09 03:34:24  Updated

This topic describes how to scale down OceanBase Migration Service (OMS).

Scenarios

OMS scaling down is applicable to the following scenarios:

  • In a multi-node deployment across multiple regions or a multi-node deployment in a single region, remove a node without reducing the number of regions.

  • In a multi-node deployment across multiple regions, after removing a node, the region corresponding to the node has no OMS machines, so the region also needs to be removed.

Remove a node without reducing the number of regions

Notice

Make sure that no components are running on the node to be removed.

For example, currently, there are two nodes, xxx.xxx.xxx.1 and xxx.xxx.xxx.2, in the Beijing region. After removing the xxx.xxx.xxx.2 node, the Beijing region should still exist. The procedure is as follows:

  1. Stop the OMS container on the target machine.

    sudo docker stop ${CONTAINER_NAME}
    

    Note

    CONTAINER_NAME is the name of the container.

  2. Delete the data in the host table of the CM database in the region of the target machine.

    This example shows how to enter the CM database in the Beijing region and execute the following SQL statement to remove the xxx.xxx.xxx.2 node.

    delete from host where ip = 'xxx.xxx.xxx.2';
    
  3. (Optional) Review the config.yaml file of all remaining nodes in the region.

    Enter the remaining OMS container in the Beijing region, and modify the value of cm_nodes in the vim /home/admin/conf/config.yaml file to delete the IP address of the target scale-down machine.

    For example, the original config.yaml file is as follows:

    "cm_location": "2"
    "cm_nodes":
        - "xxx.xxx.xxx.1"
        - "xxx.xxx.xxx.2"
    "cm_region": "bj"
    

    The modified config.yaml file is as follows:

    "cm_location": "2"
    "cm_nodes":
        - "xxx.xxx.xxx.1"
    "cm_region": "bj"
    

Remove a node and reduce the number of regions

Notice

  • Make sure that the deployment is a multi-node deployment across multiple regions.
  • Make sure that no components are running on the node to be removed.

For example, currently, there is a node, xxx.xxx.xxx.1, in the Beijing region and a node, xxx.xxx.xxx.2, in the default region. After removing the xxx.xxx.xxx.1 node, the Beijing region is also removed, leaving only the default region. The procedure is as follows:

  1. Stop the OMS container on the target machine.

    sudo docker stop ${CONTAINER_NAME}
    

    Note

    CONTAINER_NAME is the name of the container.

  2. Clean up the database.

    1. Remove the data of the corresponding region from the cluster_info table in the RM database.

      delete from cluster_info where region = 'bj';
      
    2. Remove the data of the corresponding region from the cluster_group table in the RM database.

      delete from cluster_group where name = 'bj';
      

Contact Us