This topic describes how to install OceanBase Change Data Capture (obcdc) for obbinlog to adapt to a new OceanBase Database version.
Background information
The release cycle of obbinlog is different from that of OceanBase Database. If a new OceanBase Database version is released but no corresponding new obbinlog version is released, you can install obcdc of the corresponding version for the binlog service to adapt to the new OceanBase Database version.
Prerequisites
You have installed obbinlog.
Procedure
Note
This section describes how to install obcdc V4.2.5 in an x86-based CentOS Linux 7.9 image. The procedure may differ for other environments.
Download the installation package of obcdc.
Visit OceanBase Download Center, search for OceanBase Capture Data Change, and then download the installation package of the required version based on the actual environment. Alternatively, visit the website of open-source images of Alibaba Cloud, go to the corresponding download page based on the actual environment, search for
oceanbase-ce-cdc, and then download the installation package of the required version.Decompress the RPM package.
[admin@test001 rpm]$ rpm2cpio oceanbase-ce-cdc-4.2.5.0-100010012024110110.el7.x86_64.rpm | cpio -divAfter the decompression, the following files appear in the
./home/admin/oceanbase/lib64directory:libobcdc.so -> libobcdc.so.4 libobcdc.so.4 -> libobcdc.so.4.2.5.0 libobcdc.so.4.2.5.0Create a directory for obcdc.
In the
obcdcfolder under the installation directory of obbinlog, subfolders are named in the format ofobcdc-ce-${version}.x-access, where${version}represents the first three digits of the version number, for example,obcdc-ce-4.2.5.x-access.Find the directory for an obcdc version close to the version to be installed, for example,
obcdc-ce-4.2.4.x-access. Copy the directory to create one for the version to be installed, for example,obcdc-ce-4.2.5.x-access.[admin@test001 rpm]$ sudo cp -av /home/ds/oblogproxy/obcdc/obcdc-ce-4.2.4.x-access /home/ds/oblogproxy/obcdc/obcdc-ce-4.2.5.x-accessIn this example,
/home/ds/oblogproxy/is the default installation path of obbinlog. You need to replace it with the actual installation path.Replace libobcdc files
Delete the original libobcdc files in the new obcdc directory, and copy the libobcdc files to be installed to the directory.
[admin@test001 rpm]$ sudo rm -f /home/ds/oblogproxy/obcdc/obcdc-ce-4.2.5.x-access/libobcdc.so* [admin@test001 rpm]$ sudo cp -av ./home/admin/oceanbase/lib64/libobcdc.so* /home/ds/oblogproxy/obcdc/obcdc-ce-4.2.5.x-accessIn this example,
/home/ds/oblogproxy/is the default installation path of obbinlog. You need to replace it with the actual installation path.Start the binlog server.
If the binlog server has never been started on the current node, start it based on the Step 2: Configure and start the binlog server section in the Deployment guide topic.
If the binlog server has already been started on the current node, you need to restart the binlog server for obcdc to take effect. The restart method varies based on the startup method and the value of the supervise_start parameter.
Restart by using supervisord
In a scenario where the binlog server is started by using the
env/deploy.shdeployment script andsupervise_startis set totrue, the script will install supervisord and use it to start the program. In this case, you can run the following command to restart the binlog server:[admin@test001 oblogproxy]$ supervisorctl restart binlogRestart without using supervisord
In other scenarios, you can run the following commands to restart the binlog server:
[admin@test001 oblogproxy]$ sudo ./run.sh stop [admin@test001 oblogproxy]$ sudo ./run.sh start