Upgrade the binlog service
You can run the env/deploy.sh script to upgrade obbinlog. To do so, perform the following steps:
Note
This topic uses the upgrade of binlog service Community Edition as an example. To upgrade binlog service Enterprise Edition, contact OceanBase Technical Support to obtain the obbinlog installation package of the target version, and then follow the steps below.
Download the obbinlog RPM package of the target version and decompress it. This operation does not directly install obbinlog.
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 -idvThe decompressed RPM package is stored in the
./home/ds/oblogproxydirectory.Stop the binlog server.
Notice
This operation stops the current node from receiving new client requests, but does not affect the running binlog instances or the clients that are consuming binlogs.
cd /home/ds/oblogproxy ./run.sh stopUse the
./home/ds/oblogproxy/env/deploy.shscript in the new package to update the original package.cd ./home/ds/oblogproxy/env sh deploy.sh -m upgrade -d /home/ds/oblogproxyIn this example, the
-dparameter specifies the original installation path of obbinlog. Modify it based on the actual installation path.Start the binlog server.
cd /home/ds/oblogproxy ./run.sh startThe upgrade of a binlog server node is completed.
Note
After all the binlog server nodes in the cluster are upgraded, binlog instances created or started later will use the new obbinlog package. For information about how to upgrade the existing binlog instances, see the Rotating-upgrade binlog instances section in this topic.
Rotating-upgrade binlog instances
You can upgrade binlog instances of a binlog task in rotating mode to reduce impact on your business.
If your binlog task involves multiple binlog instances, perform the following steps:
Run the
SHOW BINLOG STATUScommand to query the primary binlog instance of the current binlog task. For more information about the command, see Task management.Run the
SHOW BINLOG INSTANCEScommand to query all binlog instances of the current binlog task. For more information about the command, see Instance management.Upgrade the nodes where the binlog instances other than the primary one reside. For more information, see the Upgrade the binlog service section in this topic.
Run the
STOP BINLOG INSTANCEandSTART BINLOG INSTANCEcommands to restart the binlog instances on the upgraded nodes. For more information about the commands, see Instance management.Run the
SWITCH MASTER INSTANCEcommand to switch an upgraded binlog instance to be the primary instance of the current tenant. For more information about the command, see Instance management.Upgrade the nodes where the remaining binlog instances reside, and restart the binlog instances. For more information, see the Upgrade the binlog service section in this topic.
If your binlog task involves only one binlog instance, perform the following steps:
Upgrade the node where the binlog instance resides. For more information, see Upgrade the binlog service section in this topic.
Run the
CREATE BINLOG INSTANCEcommand to create a binlog instance. For more information about the command, see Instance management.Run the
SWITCH MASTER INSTANCEcommand to switch the new binlog instance to be the primary instance of the current tenant. For more information about the command, see Instance management.If you want to retain only one binlog instance, run the
DROP BINLOG INSTANCEcommand to drop the old one. For more information about the command, see Instance management.
Update the configurations of an existing binlog instance
After a binlog instance is created, most of its configurations cannot be modified. If you want to update its configurations, you must rebuild it.
To reduce impact on your business, you can progressively rebuild the binlog instance by using control commands. For more information about the commands, see Instance management.
Run the
CREATE BINLOG INSTANCEcommand to create a binlog instance.Run the
SWITCH MASTER INSTANCEcommand to switch the new binlog instance to be the primary instance of the current tenant.Run the
DROP BINLOG INSTANCEcommand to drop the old binlog instance.