This topic describes how to migrate a cluster between IDCs in OceanBase Cloud Platform (OCP).
Scenarios
When you migrate OceanBase and OBProxy clusters between IDCs in OCP, you must move out and take over the clusters in standard sequence.
Prerequisites
- The OBProxy cluster to be moved out is in the RUNNING state.
- The OceanBase cluster to be moved out is in the STOPPED, RUNNING, or UNAVAILABLE state.
- All OBServer nodes in the OceanBase cluster to be taken over are running normally.
- The service names of tenants in the OceanBase cluster to be taken over and existing service names in the system are unique. For more information about service names, see Manage service names.
- The host where the OBProxy to be taken over resides has only one obproxy process.
- The host where the OBProxy to be taken over resides has been added to OCP.
- If the version of the OBProxy cluster is V4.0 or later, only an OBProxy of V4.0.0 or later can be taken over.
- If the version of the OBProxy cluster is V3.x or earlier, only an OBProxy of a version later than V1.8 and earlier than V4.0.0 can be taken over.
Technical mechanism
When OceanBase and OBProxy clusters are deployed on the same host, the host cannot be managed on the original OCP node if you migrate only the OceanBase or OBProxy cluster. In this case, one host may be managed by multiple OCP nodes at the same time. Therefore, you must migrate the OceanBase and OBProxy clusters in the following sequence: Move out the OBProxy cluster > Move out the OceanBase cluster > Take over the OceanBase cluster > Take over the OBProxy cluster.
- If you move out the OceanBase cluster first, the config server of OCP does not return information about the OceanBase cluster. Consequently, business applications may be disconnected from the OceanBase cluster.
- If you move out the OBProxy cluster first, the config server returns an error when the OBProxy cluster attempts to access the OceanBase cluster again. The OBProxy cluster will then access the OceanBase cluster based on the cached RootService list. Therefore, business applications will not be disconnected from the OceanBase cluster.
- OceanBase cluster connection information is automatically added when the OBProxy cluster is taken over. If the target OceanBase cluster is not managed by OCP, an error will occur. Therefore, you must take over the OceanBase cluster before the OBProxy cluster.
Procedure
Step 1: Move out the OBProxy cluster
On the OBProxy cluster overview page, find the target OBProxy cluster and go to its overview page.
Click the ... icon in the upper-right corner and select Move Out OBProxy Cluster.
In the dialog box that appears, confirm the information and submit a task to move out the OBProxy cluster.
If the OBProxy cluster to be moved out is associated with OceanBase Load Balancer (OBLB) or Alibaba Cloud Server Load Balancer (SLB) instances, information about these instances is displayed in the dialog box. If you want to continue to use these load balancer instances after the takeover, you can click Export to export the information. OCP will save the exported information in a local configuration file for the load balancer instances. You can import this file when you configure a takeover task.
A list of hosts involved in the move-out is displayed in the dialog box. We recommend that you select the hosts where no other services are deployed to remove the hosts after the OBProxy cluster is moved out. If the removed hosts are in the offline state, you need to log in to the corresponding hosts and uninstall OCP Agent after OCP completes the move-out task.
Step 2: Move out the OceanBase cluster
On the OceanBase cluster overview page, find the target OceanBase cluster and go to its overview page.
Click the ... icon in the upper-right corner and select Migrate Cluster.
In the dialog box that appears, confirm the information and submit a task to move out the OceanBase cluster.
Export credentials: After you configure an encryption key for the credential file, click Export Credential. The system will export the credentials of the OceanBase cluster to be moved out. After the OceanBase cluster is taken over to the target OCP node, you can import its credentials in batches for future use.
Specify whether to retain information about the OceanBase cluster to be moved out. If you specify to retain the cluster information, the name, ID, status, OceanBase Database version, and creation time of the cluster will be retained in the cluster list after the cluster is moved out, and the values of other columns are displayed as
-for the cluster. You can only delete the cluster but not perform other O&M operations on the cluster or go to its overview page.
Step 3: Take over the OceanBase cluster
On the Clusters page, click Take over Cluster in the upper-right corner.
Connect to the cluster directly or through an OBProxy.
After the cluster is connected, perform a pre-takeover check.
If the check succeeds and the hosts corresponding to some OBServer nodes are not managed by OCP and need to be taken over, you must select the credentials of these hosts for unified management in OCP.
If the check fails, hover the pointer over the icon next to Failed, modify the OBServer node configuration as prompted, and then click Recheck.
After the task is submitted, you can view the task execution progress on the submission result page or return to the overview page of the cluster.
Step 4: Take over the OBProxy cluster
On the OBProxy cluster overview page, find the target OBProxy cluster and go to its overview page.
Click Take over OBProxy in the upper-right corner to go to the OBProxy takeover page.
Configure the following information:
root@proxysys password: Optional.
Host information: Specify the IDC, host type, IP address, and SQL port of the OBProxies to be taken over.
Load balancer information: Enter the information of the OBLB and SLB instances originally associated with the OBProxies to be taken over if you want to continue to use these instances on the target OCP node. You can also import the configuration file of the load balancer instances. The file was exported by OCP when you moved out the OBProxy cluster.
Notice
- You can specify the information of only existing load balancer instances. This step does not create a load balancer instance.
- All OBProxies corresponding to the specified load balancer instances must be included in the scope of the takeover task.
Click Next to proceed to the precheck step.
OCP cannot take over OBProxies whose parameters are inconsistent with those of the target OBProxy cluster. You must agree to change the parameters of the OBProxies. If any parameter takes effect only after a restart, the OBProxies will be restarted during the takeover process. Click Modify and enter confirm in the dialog box that appears to submit the OBProxy takeover task. The OBProxies are successfully taken over after the task is completed.
FAQ
Will the upper-level business be disconnected after an OBProxy cluster is moved out?
In most cases, the business will not be disconnected. This is because the move-out of an OBProxy cluster does not change the association between the OBProxy cluster and the load balancer instances or OBServer nodes.
If an OBProxy cluster in CONFIG_URL mode is moved out from OCP, an error will occur when the OBProxy cluster attempts to access the ConfigUrl again. The OBProxy cluster will then access the OceanBase cluster based on local cached information. Therefore, the business will not be disconnected provided that you do not restart the OBProxy cluster. However, the OBProxy cluster can no longer obtain the latest RootService information from the original ConfigUrl. If the RootService information changes, the OBProxy cluster reports a routing error. In this case, the business is disconnected. To address this issue, we recommend that you use another OCP node to take over the moved-out OBProxy cluster at the earliest opportunity, or specify an appropriate ConfigUrl for the OBProxy cluster.
What can I do if the precheck returns the following error message: "Unable to obtain the information of the connectable OceanBase clusters of the OBProxy. Make sure that the OBProxy is configured with a connectable OceanBase cluster."?
You must use the current OBProxy to access an OceanBase cluster and run the precheck again. This error message indicates that you have not used the OBProxy. You can delete the OBProxy and rebuild it.
What can I do if I cannot add an OceanBase cluster of V4.x as an accessible cluster after I created an empty target OBProxy cluster?
OCP does not allow you to associate an empty OBProxy cluster with an OceanBase cluster of V4.x. You can add an OBProxy of V4.x to the empty OBProxy cluster and proceed with the takeover process. To be specific, add accessible OceanBase clusters and then take over OBProxies. After the takeover task is completed, you can delete the temporarily added OBProxy if it is no longer required.
What can I do if the precheck returns the following error message: "The obproxy {ip1},{ip2},{ip3} corresponding to lb instance {ip}:{port} is not all included in the scope of this takeover."?
This error message indicates that some of the OBProxies corresponding to the specified load balancer instance are not included in the scope of the takeover task. You can add all OBProxies corresponding to the specified load balancer instance to the same batch for takeover, or ignore the load balancer instance. If you choose to ignore this load balancer instance, you do not need to enter its information for the new OCP node.