Upgrade Binlog service
You can use the installation deployment script env/deploy.sh to upgrade obbinlog. The operation is as follows:
Note
This example describes how to upgrade the Community Edition Binlog service. If you want to upgrade the Enterprise Edition Binlog service, you need to contact OceanBase Technical Support to obtain the new version of obbinlog and then execute the rpm2cpio command and subsequent operations as described below.
Download and decompress the new version of the obbinlog RPM package. Note that you do not install it directly.
wget https://mirrors.aliyun.com/oceanbase/community/stable/el/7/x86_64/obbinlog-ce-4.2.0-100000152024122710.el7.x86_64.rpm rpm2cpio obbinlog-ce-4.2.0-100000152024122710.el7.x86_64.rpm | cpio -idvAfter the execution is complete, the new version of the RPM package will be decompressed to the
./home/ds/oblogproxydirectory in the current directory.Stop the Binlog Server.
Notice
This operation will temporarily prevent the node from receiving new client requests, but will not affect the running Binlog instances and clients consuming Binlog logs.
cd /home/ds/oblogproxy ./run.sh stopUse the
./home/ds/oblogproxy/env/deploy.shscript in the decompressed new version of the program package to update the program package.cd ./home/ds/oblogproxy/env sh deploy.sh -m upgrade -d /home/ds/oblogproxyIn the above operation, the
-dparameter specifies the installation directory of the old version of obbinlog. If you deployed it in a different directory, please modify it accordingly.Start the Binlog Server.
cd /home/ds/oblogproxy ./run.sh startAt this point, the Binlog Server node has been updated.
Note
After the Binlog cluster nodes are upgraded, new or started Binlog instances will use the new version of the obbinlog program package. If you want to upgrade existing Binlog instances, please refer to Rotational upgrade of Binlog task for the operation.
Rotational upgrade of Binlog task
You can reduce the impact of the Binlog task upgrade on your business by rotating the upgrade of the Binlog instances.
If your Binlog task has multiple Binlog instance replicas, you can follow the steps below:
Use the
SHOW BINLOG STATUScommand to determine the primary Binlog instance of the current Binlog task. For more information about this command, see Task management.Use the
SHOW BINLOG INSTANCEScommand to determine the distribution of all Binlog instances in the current Binlog task. For more information about this command, see Instance management.Refer to the steps in Upgrade Binlog service to upgrade the nodes hosting the non-primary Binlog instances.
Use the
STOP BINLOG INSTANCEandSTART BINLOG INSTANCEcommands to restart the Binlog instances on the upgraded nodes. For more information about these commands, see Instance management.Use the
SWITCH MASTER INSTANCEcommand to switch the primary instance of the current tenant to the upgraded Binlog instance. For more information about this command, see Instance management.Refer to the steps in Upgrade Binlog service to upgrade the remaining Binlog nodes and restart the remaining Binlog instances.
If your Binlog task has only one Binlog instance replica, you can follow the steps below:
Refer to the steps in Upgrade Binlog service to upgrade the Binlog node.
Use the
CREATE BINLOG INSTANCEcommand to create a new Binlog instance. For more information about this command, see Instance management.Use the
SWITCH MASTER INSTANCEcommand to switch the primary instance of the current tenant to the newly created Binlog instance. For more information about this command, see Instance management.If you want to retain only one Binlog instance, you can use the
DROP BINLOG INSTANCEcommand to delete the old Binlog instance. For more information about this command, see Instance management.
Update the configuration of an existing Binlog task
After a Binlog instance is created, most configurations cannot be changed. If you need to update the configuration of the Binlog instance, you generally need to rebuild the Binlog instance.
To avoid the rebuilding process from severely impacting production, you can use the relevant management commands in Instance management to gradually rebuild the Binlog task.
Use the
CREATE BINLOG INSTANCEcommand to create a new Binlog instance.Use the
SWITCH MASTER INSTANCEcommand to switch the primary instance of the current tenant to the newly created Binlog instance.Use the
DROP BINLOG INSTANCEcommand to delete the old Binlog instance.
