This topic describes how to use OCP to take over an OceanBase cluster deployed by obd.
Prerequisites
Before you proceed, make sure that the following conditions are met:
You have installed obd V2.4.0 or later. We recommend that you install the latest version. For more information, see Install obd.
You have installed OCP V3.1.1 or later. We recommend that you install the latest version.
All OBServer nodes in the OceanBase cluster to be taken over are running, and only one observer process is running on each OBServer node.
Note
If the OCP version used for takeover is earlier than V4.2.0, make sure that the observer process is started by the admin user.
Procedure
Note
The following example uses
testas the deployment name of the OceanBase cluster to be taken over. You need to replace it with the actual deployment name. You can execute theobd cluster listcommand to view the deployment name. TheNamefield in the output indicates the deployment name.For more information about the obd commands used in this topic, see Cluster commands.
Step 1: Check whether the OceanBase cluster meets the takeover conditions
Before you use OCP to take over an OceanBase cluster deployed by obd, run the following command to check whether the OceanBase cluster meets the takeover conditions. If the conditions are not met, you can modify the cluster based on the prompt.
obd cluster check4ocp test -V 4.4.0
-V specifies the version of OCP used for takeover. The command output is as follows:
Get local repositories ok
Load cluster param plugin ok
Open ssh connection ok
Connect to observer 10.10.10.2:2881 ok
Configurations of the oceanbase-ce can be taken over by OCP.
oceanbase-ce Check passed.
Remote oceanbase-ce-utils-4.5.0.0-100000012025112711.el7-eb2f66c9fe4becee1400a6472a6e53e7bd5d8227 repository install ok
Trace ID: 236333ea-e209-11f0-b4a3-00163e42fe29
If you want to view detailed obd logs, please run: obd display-trace 236333ea-e209-11f0-b4a3-00163e42fe29
Step 2: Take over the cluster
Upload the ocp-agent installation package
You can download the ocp-agent installation package from Aliyun Open Source Mirror based on your environment. After the download is complete, log in to the OCP console by using a browser, choose System Management > Software Package Management in the left-side navigation pane, and click Upload in the upper-right corner of the Software Package page. Then, click Select a software package and select the ocp-agent installation package from your local device to upload it.
Run the takeover command
obd cluster export-to-ocp test -a http://10.10.10.1:8080 -u admin -p ********-aspecifies the address of OCP;-uspecifies the OCP user, which must have the permission to take over the cluster; and-pspecifies the password of the user. The command output is as follows:Open ssh connection ok Remote oceanbase-ce-utils-4.5.0.0-100000012025112711.el7-eb2f66c9fe4becee1400a6472a6e53e7bd5d8227 repository install ok Connect to http://10.10.10.1:8080 ok Connect to observer 10.10.10.2:2881 ok Configurations of the oceanbase-ce can be taken over by OCP. takeover task successfully submitted to ocp, you can check task at http://10.10.10.1:8080/task/25 Trace ID: 5c4f6ebc-e0a1-11f0-9268-00163e3eb36c If you want to view detailed obd logs, please run: obd display-trace 5c4f6ebc-e0a1-11f0-9268-00163e3eb36cView the takeover progress
Log in to the OCP console, and click Task Center in the upper-right corner of the page to go to the Task page, where you can view the progress of the takeover task.
After the takeover task is completed, you can click Cluster in the left-side navigation pane to go to the Cluster page, where you can view the taken-over cluster. The status of the cluster is Running.
Step 4: Create an OBProxy cluster
After you use OCP to take over an OceanBase cluster, you must create an OBProxy cluster and associate it with the taken-over OceanBase cluster.
If the original ODP uses a VIP, you can add the newly created ODP in OCP to the VIP one by one, and then offline the original ODP from the VIP one by one.
FAQ
Can I reuse the original ODP?
If you have deployed multiple ODPs and access them through a VIP, you can offline them one by one, deploy ODPs on the same machines in OCP, and add them back to the VIP. This way, you can reuse the machines.
Can I keep the original ODP?
Yes. The original ODP can still connect to the taken-over OceanBase cluster. However, we recommend that you replace the original ODP with a new one created in OCP for easier maintenance and management.
