This topic describes how to use a CLI to upgrade the arbitration service.
Limitations
If an OceanBase cluster is associated with the 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:
If there is a barrier version between the current version and the target version, the upgrade process is as follows:
- 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.
If there is no barrier version between the current version and the target version, the upgrade process is as follows:
- 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.1.0.1 > V4.2.0.0
The following example describes how to upgrade a two-replica OceanBase cluster with the arbitration service.
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.
If the current arbitration service 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 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. If an associated OceanBase cluster has a downgraded log stream, do not perform the upgrade, as it may result 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_namespecifies the name of the RPM package.$observer_ipspecifies the IP address of the arbitration server.$rpm_dirspecifies 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 there are multiple barrier versions in the upgrade path, they should be installed and upgraded in sequence, one by one, until the final barrier version is successfully upgraded. After that, the RPM package for the target version can be installed.
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
For more information about how to upgrade an OceanBase cluster, see Overview.