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:
Stop the OMS container on the target machine.
sudo docker stop ${CONTAINER_NAME}Note
CONTAINER_NAMEis the name of the container.Delete the data in the
hosttable 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.2node.delete from host where ip = 'xxx.xxx.xxx.2';(Optional) Review the
config.yamlfile of all remaining nodes in the region.Enter the remaining OMS container in the Beijing region, and modify the value of
cm_nodesin thevim /home/admin/conf/config.yamlfile to delete the IP address of the target scale-down machine.For example, the original
config.yamlfile is as follows:"cm_location": "2" "cm_nodes": - "xxx.xxx.xxx.1" - "xxx.xxx.xxx.2" "cm_region": "bj"The modified
config.yamlfile 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:
Stop the OMS container on the target machine.
sudo docker stop ${CONTAINER_NAME}Note
CONTAINER_NAMEis the name of the container.Clean up the database.
Remove the data of the corresponding region from the
cluster_infotable in the RM database.delete from cluster_info where region = 'bj';Remove the data of the corresponding region from the
cluster_grouptable in the RM database.delete from cluster_group where name = 'bj';