This topic describes how to upgrade an arbitration service using a CLI.
Notice
You can upgrade an OceanBase cluster of V4.3.0 Beta to V4.3.1 Beta. At present, you cannot upgrade an OceanBase cluster of V4.2.x or earlier to V4.3.1 Beta. As the version evolves, upgrades from V4.2.x to V4.3.x will be supported.
Limitations
If an OceanBase cluster is associated with an arbitration service, take note of the following limitations:
You must upgrade the arbitration service before you upgrade the OceanBase cluster.
The new version of the arbitration server must be compatible with the versions of all associated clusters. You can check the
oceanbase_upgrade_dep.ymlfile for version compatibility. For example, if thecan_be_upgraded_toattribute of version A is B, which is later than version A, version B is compatible with version A. In this case, the arbitration service of version B is compatible with the OceanBase cluster whose version is A. For information about theoceanbase_upgrade_dep.ymlfile, see Step 1: Analyze theoceanbase_upgrade_dep.ymlfile in Upgrade an OceanBase cluster.
Note
You can query the oceanbase.DBA_OB_ARBITRATION_SERVICE view of the sys tenant to check whether the current OceanBase cluster is associated with the arbitration service.
Procedure
Step 1: Confirm the upgrade process
For more information, see Step 1: Analyze the oceanbase_upgrade_dep.yml file in Upgrade an OceanBase cluster to confirm the upgrade sequence from the current version to the target version. Determine the upgrade process based on the upgrade sequence as follows:
When the current version cannot be directly upgraded to the target version:
- Upgrade the arbitration service to the barrier version.
- (Optional) Upgrade all OceanBase clusters associated with the arbitration service to the barrier version.
- If several barrier versions are involved, repeat steps 1 and 2 until the arbitration service and the associated OceanBase clusters can be directly upgraded to the target version.
- Upgrade the arbitration service to the target version.
- Upgrade all OceanBase clusters associated with the arbitration service to the target version.
When the current version can be directly upgraded to the target version:
- Upgrade the arbitration service to the target version.
- (Optional) Upgrade all OceanBase clusters associated with the arbitration service to the target version.
Here is an example:
Assume that the upgrade sequence is as follows:
- V4.1.0.0-100000982023031415 > V4.1.0.0 > V4.1.0.1 (barrier version) > V4.2.0.0
- V4.1.0.0 > V4.1.0.1 > V4.2.0.0
- V4.3.0.0 > V4.3.0.1 > V4.3.1.0
The following example describes how to upgrade a two-replica OceanBase cluster with the arbitration service.
Scenario 1: The upgrade sequence involves barrier versions. If the current arbitration service version is V4.1.0.0-100000982023031415, the upgrade process is as follows:
- Upgrade the arbitration service version from V4.1.0.0-100000982023031415 to the barrier version V4.1.0.1.
- Upgrade the OceanBase cluster from V4.1.0.0-100000982023031415 to the barrier version V4.1.0.1.
- Upgrade the arbitration service to the target version V4.2.0.0.
- Upgrade the OceanBase cluster to the target version V4.2.0.0.
Scenario 2: The upgrade sequence does not involve barrier versions. If the current arbitration service version is V4.3.0.0, the upgrade process is as follows:
- Upgrade the arbitration service version to the target version V4.3.1.0.
- Upgrade the OceanBase cluster to the target version V4.3.1.0.
(Optional) Step 2: Check for downgraded log streams
If the arbitration service is not associated with any OceanBase cluster, skip this step.
Before you upgrade the arbitration service, make sure that the associated OceanBase clusters have no downgraded log streams. When an associated OceanBase cluster has a downgraded log stream, the arbitration service fails in the upgrade, resulting in the absence of the leader replica.
You can execute the following SQL statement in the sys tenant to check for downgraded log streams. If any log stream is returned, you must stop the upgrade process.
SELECT tenant_id,ls_id FROM GV$OB_LOG_STAT WHERE role = 'LEADER' AND degraded_list != "";
Step 3: Upload and install the RPM package of the target version
Run the
scpcommand to upload the OceanBase RPM package to the arbitration server.scp $rpm_name admin@$observer_ip:/$rpm_dirwhere:
$rpm_nameindicates the name of the RPM package.$observer_ipindicates the IP address of the arbitration server.$rpm_dirindicates the directory where the RPM package is stored.
Here is an example:
scp oceanbase-4.2.0.0-100010022023081911.el7.x86_64.rpm admin@10.10.10.1:/home/admin/rpmInstall the OceanBase RPM package.
Notice
If the upgrade path involves multiple barrier versions, install and upgrade the versions in sequence and then install the RPM package of the target version.
rpm -Uvh $rpm_nameHere,
$rpm_nameindicates the name of the RPM package.
Step 4: Upgrade the arbitration service
Log on to the arbitration server.
(Optional) Switch to the
adminuser.If you have logged on to the arbitration server as the
adminuser, skip this step.Here is an example:
[root@xxx /home/admin/oceanbase/etc]# su - adminRun the following command to obtain the process ID of the node.
ps -ef | grep observer | grep -v grepHere is an example:
-bash-4.2$ ps -ef | grep observer | grep -v grep admin 103364 1 99 2022 ? 51-17:24:41 /home/admin/oceanbase/bin/observerRun the following command to stop the arbitration server process.
kill -9 $pidHere,
$pidis the process ID of the arbitration server.Here is an example:
-bash-4.2$ kill -9 103364Run the following command to restart the arbitration server process.
-bash-4.2$ cd /home/admin/oceanbase && /home/admin/oceanbase/bin/observerNote
You do not need to specify the startup parameters when you restart the arbitration server process because the startup parameters of the earlier version are automatically written to the parameter file.
(Optional) Step 5: Upgrade the OceanBase cluster
If the arbitration service is not associated with any OceanBase cluster, skip this step.
For more information about how to upgrade an OceanBase cluster, see Upgrade an OceanBase cluster.
References
- If you are using OceanBase Cloud Platform (OCP) to manage the OceanBase cluster and the arbitration service, you can perform the upgrade directly by following the instructions provided in the OCP console. For more information, see Upgrade an OceanBase Cluster and Upgrade an arbitration service.
- For more information about how to upgrade an OceanBase cluster, see Overview.