This topic describes how to upgrade OceanBase Cloud Platform (OCP) Express by running commands of OceanBase Deployer (OBD) on the CLI.
Note
At present, you can upgrade OCP Express only by running OBD commands on the CLI.
Prerequisites
You have deployed OCP Express.
The OBD version must be V2.1.0 or later.
Obtain the hash value of OCP Express
Before you upgrade OCP Express, you must know the hash value of the target version. You can use one of the following methods to obtain the hash value:
Method 1: obtain the hash value online
If your server can access the Internet, you can upgrade OBD and use it to obtain the information from the remote image repository. Perform the following steps:
Run the following command to connect to the remote image repository:
obd mirror enable remoteRun the following command to upgrade OBD to the latest version:
obd updateRun the following command to view the OBD version and verify whether the upgrade is successful:
obd --versionRun the following command to query the version of OCP Express in the remote repository:
obd mirror list oceanbase.community.stable|grep ocp-expressIn the following sample output, the strings displayed in the rightmost column are the hash values of the corresponding versions of OCP Express.
| ocp-express | 1.0.0 | 100000432023032015.el7 | x86_64 | c6156b6676746d697e0bb46b50a062ce188cb76f2f95f1fd4d6ac14dd8d71f76 | | ocp-express | 1.0.0 | 100000452023041914.el7 | x86_64 | a70d09919bcbad065270e8ff3984ef18c332c2f5983b756fc55956ce910f7d2d |
Method 2: obtain the hash value offline
If your server cannot access the Internet, you can download the OceanBase all-in-one installation package to upgrade OBD and then obtain the required information. Perform the following steps:
Download the all-in-one installation package.
Download the all-in-one installation package from OceanBase Download Center and copy it to the central control server. We recommend that you download the latest version of the all-in-one installation package.
In the directory where the installation package is located, run the following commands to decompress and install the package.
Notice
You must install the all-in-one installation package with the same account that you use to install OCP Express.
If you have installed the all-in-one installation package, we recommend that you use the
upgrade.shscript to upgrade OBD after you download and decompress the package. To be specific, replace the./install.shcommand in the sample code with the./upgrade.shcommand.
[admin@test001 ~]$ tar -xzf oceanbase-all-in-one-*.tar.gz [admin@test001 ~]$ cd oceanbase-all-in-one/bin/ [admin@test001 bin]$ ./install.sh [admin@test001 bin]$ source ~/.oceanbase-all-in-one/bin/env.shRun the following command to query the version of OCP Express in the remote repository:
obd mirror list localIn the following sample output, the strings displayed in the rightmost column are the hash values of the corresponding versions of OCP Express.
| ocp-express | 1.0.0 | 100000432023032015.el7 | x86_64 | 42c6fc921063f24f9e1072d75bfa7f21f42146e3 | | ocp-express | 1.0.0 | 100000452023041914.el7 | x86_64 | 5b29837dc1f575c7d1840ab8e59064ddd407bd4b |
Upgrade OCP Express
Intra-version upgrade
You can run the obd cluster reinstall command to perform an intra-version upgrade of OCP Express. For more information about the obd cluster reinstall command, see Cluster commands.
Run the following command to upgrade OCP Express to the target version by using the obtained MD5 hash value:
obd cluster reinstall obtest -c ocp-express --hash=a70d09919bcbad065270e8ff3984ef18c332c2f5983b756fc55956ce910f7d2d
Inter-version upgrade
You can run the obd cluster upgrade command to perform an inter-version upgrade of OCP Express. For more information about the obd cluster upgrade command, see Cluster commands.
Run the following command to upgrade OCP Express to the target version by using the obtained MD5 hash value:
obd cluster upgrade <deploy name> -V <version> -c ocp-express --usable=<hash>
Verify the upgrade
The account and password that you use to log on to the OCP console are not affected by the OCP Express upgrade. You can log on to the OCP console, choose Help > About OCP Express. On the page that appears, check the version number and release date to verify whether the OCP Express is upgraded to the target version.