This topic describes how to upgrade the arbitration service by using commands.
Limitations
If the arbitration service is associated with an OceanBase cluster, the following limitations apply:
Before upgrading the OceanBase cluster, you must upgrade the arbitration service.
You must confirm that the new version is compatible with all associated clusters. To determine compatibility between two versions, refer to the
oceanbase_upgrade_dep.ymlfile. For example, if version A'scan_be_upgraded_toattribute is version B (indicating B has a higher version number), then version B is compatible with version A. Consequently, the arbitration service for version B is also compatible with the OceanBase cluster of version A. For more information about theoceanbase_upgrade_dep.ymlfile, see Step 1: Analyze the oceanbase_upgrade_dep.yml file in Upgrade an OceanBase cluster.
Note
You can query the oceanbase.DBA_OB_ARBITRATION_SERVICE view in the sys tenant to check whether the arbitration service is associated with the OceanBase cluster.
Procedure
Step 1: Confirm the upgrade process
Please refer to the Step 1: Analyze the oceanbase_upgrade_dep.yml file section in Upgrade an OceanBase cluster of OceanBase cluster version upgrade to confirm the upgrade sequence from the current version to the target version. Based on the upgrade sequence, the upgrade process is as follows:
If there are barrier versions between the current version and the target version, the upgrade process is as follows:
- Upgrade the arbitration service to the barrier version.
- (Optional) If any OceanBase clusters are associated with this arbitration service, upgrade all associated OceanBase clusters to the barrier version.
- If there are other barrier versions after this, repeat steps 1 and 2 until the arbitration service and all associated OceanBase clusters are upgraded to the barrier version before the target version.
- Upgrade the arbitration service to the target version.
- Upgrade all associated OceanBase clusters to the target version.
If there are no barrier versions between the current version and the target version, the upgrade process is as follows:
- Upgrade the arbitration service to the target version.
- (Optional) If any OceanBase clusters are associated with this arbitration service, upgrade all associated OceanBase clusters to the target version.
Example:
Assume the upgrade sequence is as follows:
- V4.1.0.0-100000982023031415 > V4.1.0.0 > V4.1.0.1 (barrier) > V4.2.0.0
- V4.1.0.0 > V4.1.0.1 > V4.2.0.0
- V4.1.0.1 > V4.2.0.0
The following example describes the upgrade process for an OceanBase cluster with two replicas and an arbitration service:
If the current version is V4.1.0.0-100000982023031415, the upgrade process is as follows:
- Upgrade the arbitration service from V4.1.0.0-100000982023031415 to V4.1.0.1 (barrier).
- Upgrade the OceanBase cluster from V4.1.0.0-100000982023031415 to V4.1.0.1 (barrier).
- Upgrade the arbitration service to the target version V4.2.0.0.
- Upgrade the OceanBase cluster to the target version V4.2.0.0.
If the current version is V4.1.0.0, the upgrade process is as follows:
- Upgrade the arbitration service to the target version V4.2.0.0.
- Upgrade the OceanBase cluster to the target version V4.2.0.0.
(Optional) Step 2: Check whether any log streams are in the degraded state
If the arbitration service you are upgrading is not associated with any OceanBase clusters, you can skip this step.
Before upgrading the arbitration service, check whether any log streams of the associated OceanBase clusters are in the degraded state. If any log streams are in the degraded state, you cannot proceed with the upgrade, which may result in a leaderless state.
Execute the following SQL statement as the sys tenant to check whether any log streams are in the degraded state. If the execution result is not empty, it indicates that there are log streams in the degraded state, and you need to 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 target RPM package
Use the
scpcommand to upload the OceanBase RPM package required for the upgrade to the arbitration server node.scp $rpm_name admin@$observer_ip:/$rpm_dirParameters:
$rpm_name: the name of the RPM package.$observer_ip: the IP address of the arbitration server node.$rpm_dir: the directory where the RPM package is stored.
Example:
scp oceanbase-4.2.0.0-100010022023081911.el7.x86_64.rpm admin@10.10.10.1:/home/admin/rpmInstall the OceanBase RPM package by executing the following command.
Notice
If there are multiple barrier versions in the upgrade path, install and upgrade them in sequence until the last barrier version is successfully upgraded before installing the target version's RPM package.
rpm -Uvh $rpm_nameHere,
$rpm_namespecifies the name of the RPM package.
Step 4: Upgrade the arbitration service
Log in to the arbitration server.
(Optional) Switch to the
adminuser.If you log in to the arbitration server as the
adminuser, skip this step.Example:
[root@xxx /home/admin/oceanbase/etc]# su - adminExecute the following command to view and obtain the process ID of the node.
ps -ef | grep observer | grep -v grepExample:
-bash-4.2$ ps -ef | grep observer | grep -v grep admin 103364 1 99 2022 ? 51-17:24:41 /home/admin/oceanbase/bin/observerExecute the following command to stop the arbitration server process.
kill -9 $pidHere,
$pidspecifies the process ID of the arbitration server.Example:
-bash-4.2$ kill -9 103364Execute the following command to restart the arbitration server process.
-bash-4.2$ cd /home/admin/oceanbase && /home/admin/oceanbase/bin/observerNote
When you restart the arbitration server process, you do not need to specify the startup parameters because the previous startup parameters have been written to the parameter file.
(Optional) Step 5: Upgrade the OceanBase cluster
If the arbitration service you are upgrading is not associated with any OceanBase clusters, you can skip this step.
For information about how to upgrade the OceanBase cluster, see Upgrade an OceanBase cluster.
References
- If you are using OceanBase Cloud Platform (OCP) to manage OceanBase clusters and arbitration services, you can directly follow the prompts on the relevant operation interface to perform the upgrade. For more information, see Upgrade version and Upgrade arbitration service.
- For information about how to upgrade the OceanBase cluster, see Overview.
