This topic describes how to upgrade ODP by using the obd CLI.
Note
obd supports upgrading ODP Community Edition and ODP Enterprise Edition. This topic provides an example of how to upgrade ODP Community Edition.
Prerequisites
Before you start, make sure you meet these conditions:
obd is installed. We recommend that you install the latest version. For more information, see Install obd.
The ODP that needs to be upgraded is managed by obd.
Procedure
Before you upgrade ODP, make sure that the image library contains the ODP installation package for the upgrade and obtain the hash value of the target version. You can choose either of the following methods based on the environment.
If your cluster can access the internet, use the obd tool to update obd and download remote resources. The steps are as follows.
Enable the remote repository
obd mirror enable remoteAfter the command executes successfully, you can run the
obd mirror listcommand to check whether remote mirroring is enabled. If the value of theEnabledcolumn corresponding to the row withType=remoteisTrue, then remote mirroring is enabled. Sample output:+-----------------------------------------------------------------------------+ | Mirror Repository List | +----------------------------+--------+---------+----------+------------------+ | SectionName | Type | Enabled | Avaiable | Update Time | +----------------------------+--------+---------+----------+------------------+ | local | local | - | True | 2025-03-25 14:04 | | oceanbase.community.stable | remote | True | True | 2025-03-25 13:53 | | oceanbase.development-kit | remote | True | True | 2025-03-25 13:53 | +----------------------------+--------+---------+----------+------------------+Query the version of ODP in the remote image repository.
obd mirror list oceanbase.community.stable | grep obproxy-ceOutput is as follows, where the string in the last column is the hash value corresponding to the ODP version.
| obproxy-ce | 3.2.3 | 2.el7 | x86_64 | 73cccf4d05508de0950ad1164aec03003c4ddbe1415530e031ac8b6469815fea | | obproxy-ce | 3.2.3.5 | 2.el7 | x86_64 | 7398f833f77173f28ea9f26ef6ed32097f15566a3fa9e4187bab6e511f87e830 | | obproxy-ce | 4.0.0 | 5.el7 | x86_64 | 93ec26530df7458116c73654fdb7a69e4ad05d8e4bdae3d681bcc15e9ea89bc5 | | obproxy-ce | 4.1.0.0 | 7.el7 | x86_64 | b64aa00805f6b70453e7763071b2ca28640859efaf027af7239ffda856cd0d64 | | obproxy-ce | 4.2.0.0 | 7.el7 | x86_64 | 0ace7c27460366dd302d3e9426f3f57880cfa7057b1fca1a163ce06afbcd523d | | obproxy-ce | 4.2.1.0 | 11.el7 | x86_64 | a0514a9d1fc57dd29ec365bd725b45765d51235a7abefc0f54e68cda3fc63340 | | obproxy-ce | 4.2.3.0 | 3.el7 | x86_64 | 7ca6c000887b90db111093180e6984bf4cf8f7380a948870f3eb2ac30be38f37 | | obproxy-ce | 4.3.1.0 | 4.el7 | x86_64 | 70e1bede7b06470c627e69481d991983625b507298687235bb9c9fe81ebd7641 | | obproxy-ce | 4.3.2.0 | 26.el7 | x86_64 | 03848b37e9f40dffdefd526af5c8b2031f0197c6228cac5857149dda1af2cc43 | | obproxy-ce | 4.3.2.0 | 42.el7 | x86_64 | 92e5f411e024574f5f2d6b1749228dcd1f4cb2df77f470066d9df9fa1b7384b8 | | obproxy-ce | 4.3.3.0 | 5.el7 | x86_64 | 740494f578d568af209320c97d2c8699875348466ef8cde2c4cd589953452f1f |Upgrade ODP
Note
The open-source obproxy component was officially renamed to obproxy-ce starting from V3.2.3. Therefore, if you are upgrading ODP from a version earlier than V3.2.3 to V3.2.3 or later, you need to first run the following script as the obd user to modify the meta information, and then execute the upgrade command.
obd cluster upgrade test -c obproxy-ce -V 4.3.2.0 --usable=92e5f411e024574f5f2d6b1749228dcd1f4cb2df77f470066d9df9fa1b7384b8For example, you can upgrade the obproxy-ce component in the cluster whose deployment name is
testto V4.3.2.0. You must modify the following example based on the cluster.View ODP versions
Run the following command in the ODP installation directory:
./bin/obproxy -VThe output is as follows. The current ODP version is V4.3.2.0.
obproxy (OceanBase 4.3.2.0 42) REVISION: 1-local-f877a496d4c55b184ec568599ae565616437034d BUILD_TIME: Dec 6 2024 17:38:33
You can download OceanBase Database Proxy (ODP) from the OceanBase Download Center, search for OceanBase Database Proxy, and download the installation package of ODP. Then, upload this package to the node where obd is installed. Finally, run the following command in the directory where the installation package of ODP is stored to upgrade ODP.
Upload the installation package to your local image repository.
obd mirror clone obproxy-ce-*.rpmAfter you upload the images, you can run the
obd mirror list local | grep obproxy-cecommand to view the installation packages in the local image repository. The output is as follows:| obproxy-ce | 4.3.3.0 | 5.el7 | x86_64 | 19a002976e4de93a407afe6ab4323310edb936cf |Disable a remote image repository.
obd mirror disable remoteAfter the execution is successful, execute the
obd mirror listcommand to confirm whether the mirror repository has been closed. TheEnabledcolumn of the remote mirror source is changed toFalse, indicating that the remote mirror source is closed. Output is as follows:+-----------------------------------------------------------------------------+ | Mirror Repository List | +----------------------------+--------+---------+----------+------------------+ | SectionName | Type | Enabled | Avaiable | Update Time | +----------------------------+--------+---------+----------+------------------+ | local | local | - | True | 2025-03-25 14:04 | | oceanbase.community.stable | remote | False | False | 2025-03-25 13:53 | | oceanbase.development-kit | remote | False | False | 2025-03-25 13:53 | +----------------------------+--------+---------+----------+------------------+Query the local image library for the ODP version.
obd mirror list local | grep obproxy-ceThe hash value for the corresponding ODP version is displayed in the last column.
| obproxy-ce | 4.3.3.0 | 5.el7 | x86_64 | 19a002976e4de93a407afe6ab4323310edb936cf |Upgrade ODP
Description
Since V3.2.3, the obproxy component has been officially renamed to obproxy-ce. If you are upgrading the ODP from any version earlier than V3.2.3 to V3.2.3 or later, you need to modify the meta information by executing the following script as the execution user of obd. Then use the following command to perform the upgrade.
obd cluster upgrade test -c obproxy-ce -V 4.3.3.0 --usable=19a002976e4de93a407afe6ab4323310edb936cfIn this example, an obproxy-ce component of the cluster named
testis upgraded from version V4.2.1.0 to V4.3.3.0. You need to modify the sample command based on your actual requirements.View ODP versions
Execute the following command in the ODP installation directory:
./bin/obproxy -VOutput is as follows, with the current ODP V4.3.3.0.
obproxy (OceanBase 4.3.3.0 5) REVISION: 1-local-60ff90081edf7829e4f6458adb6d1184c3344b80 BUILD_TIME: Jan 21 2025 17:32:47
FAQs
If you encounter the following issues while upgrading ODP:
Stop obproxy ok
Start obproxy ok
obproxy program health check ok
Connect to obproxy x
The OBDB instance cannot be connected to the ODP. The possible reasons are as follows:
The proxy system has disabled the access to IP addresses other than
127.0.0.1, causing the obd node to be unable to connect. In this case, run the following command to connect to the proxy system:obclient -h<obproxy_ip> -uroot@proxysys -P<obproxy_port> -p<obproxy_pwd>Note
During the process of connecting proxysys, if you are unable to connect with your custom proxysys password, try connecting with an empty password or the code
proxysys.Then, execute the
alter proxyconfig set skip_proxy_sys_private_check = truecommand.The password for the obd system is inconsistent with that stored in OB Proxy. In this case, execute the preceding command to connect to obd, and then run the following command:
alter proxyconfig set obproxy_sys_password = <obproxy_pwd>to modify the obproxy password.You can modify the password to an empty string (
obproxy_sys_password = '') or set it to the password stored in the obd configuration file.
Script
OBD_HOME=${OBD_HOME:-${HOME}}/.obd
obproxy_repository=${OBD_HOME}/repository/obproxy
obproxy_ce_repository=${OBD_HOME}/repository/obproxy-ce
function shadow_repo() {
repository_path=$1
ce_repository_path=$2
[[ $repository_path =~ ^/ ]] && a=$repository_path || a=`pwd`/$repository_path
while [ -h $a ]
do
b=`ls -ld $a|awk '{print $NF}'`
c=`ls -ld $a|awk '{print $(NF-2)}'`
[[ $real_patn =~ ^/ ]] && a=$b || a=`dirname $c`/$b
done
instance_hash=`basename $a`
ce_version_path=`dirname ${ce_repository_path}`
ln -sf ${ce_version_path}/${instance_hash} ${ce_repository_path}
}
function copy_repository() {
VS=(`ls $obproxy_repository`)
for version in ${VS[@]}; do
version_path="${obproxy_repository}/${version}"
ce_version_path="${obproxy_ce_repository}/${version}"
repositories=(`ls $version_path`)
mkdir -p $ce_version_path
for repository in ${repositories[@]}; do
repository_path="${version_path}/${repository}"
ce_repository_path="${ce_version_path}/${repository}"
if [ -d "$ce_repository_path" ];
then
echo "${ce_repository_path} exist"
else
if [ -L ${repository_path} ];
then
shadow_repo ${repository_path} ${ce_repository_path}
else
cp -r ${repository_path} ${ce_repository_path}
fi
fi
done
done
}
function change_cluster_meta() {
cluster_home_path=${OBD_HOME}/cluster
CS=(`ls ${cluster_home_path}`)
for cluster in ${CS[@]}; do
cluster_path=${cluster_home_path}/$cluster
if [ -f ${cluster_path}/.data ]; then
sed -i 's/^ obproxy:/ obproxy-ce:/g' ${cluster_path}/.data
fi
sed -i 's/^obproxy:/obproxy-ce:/' ${cluster_path}/*.yaml
done
}
copy_repository && change_cluster_meta && echo 'ok'
