This topic describes how to upgrade OceanBase Database Proxy (ODP) Community Edition by running OceanBase Deployer (obd) commands on the CLI.
Note
At present, obd supports deploying and managing only ODP Community Edition. Therefore, ODP mentioned in this topic refers to ODP Community Edition.
Prerequisites
Make sure that the following conditions are met:
You have installed obd. We recommend that you install the latest version. For more information, see Install obd.
The ODP to be upgraded is managed by obd.
Procedure
Before you upgrade ODP, make sure that the installation package of the target version exists in the image repository and that you have obtained its hash value. Choose either the online or offline upgrade method based on your actual situation.
If your server can access the Internet, you can upgrade obd and use obd to obtain remote resources. Perform the following steps:
Enable remote image repositories.
obd mirror enable remoteAfter the preceding command is executed, you can run the
obd mirror listcommand to confirm whether the remote image repositories are enabled. The output is as follows, where if the values of the remote image repositories in theEnabledcolumn areTrue, the remote image sources are enabled.+-----------------------------------------------------------------------------+ | Mirror Repository List | +----------------------------+--------+---------+----------+------------------+ | SectionName | Type | Enabled | Available| 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 ODP versions in remote image repositories.
obd mirror list oceanbase.community.stable | grep obproxy-ceThe output is as follows, where the hash value of the installation package for a corresponding ODP version is displayed in the last column:
| 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 is renamed obproxy-ce starting with V3.2.3. To upgrade ODP from a version earlier than V3.2.3 to V3.2.3 or later, you must first run the script as the obd execution user to modify the metadata, and then run the following command for upgrade.
obd cluster upgrade test -c obproxy-ce -V 4.3.2.0 --usable=92e5f411e024574f5f2d6b1749228dcd1f4cb2df77f470066d9df9fa1b7384b8Here is an example of upgrading the obproxy-ce component in the
testcluster to V4.3.2.0. You must modify the information based on the actual situation.Query the current ODP version.
Run the following command in the installation directory of ODP:
./bin/obproxy -VThe output is as follows, showing that 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
If your server cannot connect to the Internet, download the desired ODP installation package from OceanBase Download Center and upload it to the server where obd resides. In the directory where the installation package is located, perform the following steps to upgrade ODP:
Upload the installation package to the local image repository.
obd mirror clone obproxy-ce-*.rpmAfter the preceding command is executed, you can run the
obd mirror list local | grep obproxy-cecommand to query the installation package in the local image repository. The output is as follows:| obproxy-ce | 4.3.3.0 | 5.el7 | x86_64 | 19a002976e4de93a407afe6ab4323310edb936cf |Disable remote image repositories.
obd mirror disable remoteAfter the preceding command is executed, you can run the
obd mirror listcommand to confirm whether the remote image repositories are disabled. The output is as follows, where if the values of the remote image repositories in theEnabledcolumn areFalse, the remote image sources are disabled.+-----------------------------------------------------------------------------+ | Mirror Repository List | +----------------------------+--------+---------+----------+------------------+ | SectionName | Type | Enabled | Available| 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 ODP version in the local image repository.
obd mirror list local | grep obproxy-ceThe output is as follows, where the hash value of the installation package for a corresponding ODP version is displayed in the last column:
| obproxy-ce | 4.3.3.0 | 5.el7 | x86_64 | 19a002976e4de93a407afe6ab4323310edb936cf |Upgrade ODP.
Note
The open source obproxy component is renamed obproxy-ce starting with V3.2.3. To upgrade ODP from a version earlier than V3.2.3 to V3.2.3 or later, you must first run the script as the obd execution user to modify the metadata, and then run the following command for upgrade.
obd cluster upgrade test -c obproxy-ce -V 4.3.3.0 --usable=19a002976e4de93a407afe6ab4323310edb936cfHere is an example of upgrading the obproxy-ce component in the
testcluster to V4.3.3.0. You must modify the information based on the actual situation.Query the current ODP version.
Run the following command in the installation directory of ODP:
./bin/obproxy -VThe output is as follows, showing that the current ODP version is V4.3.3.0:
obproxy (OceanBase 4.3.3.0 5) REVISION: 1-local-60ff90081edf7829e4f6458adb6d1184c3344b80 BUILD_TIME: Jan 21 2025 17:32:47
FAQ
If the following issue occurs during the upgrade of ODP:
Stop obproxy ok
Start obproxy ok
obproxy program health check ok
Connect to obproxy x
In other words, if obd cannot connect to ODP, the possible causes are as follows:
The
root@proxysysuser allows access only from the IP address127.0.0.1and blocks access from other IP addresses, preventing the obd server from establishing a connection. In this case, run the following command to connect to ODP by using theroot@proxysysuser:obclient -h<obproxy_ip> -uroot@proxysys -P<obproxy_port> -p<obproxy_pwd>Note
If you cannot connect to ODP by using the
root@proxysysuser and your custom password, try using an empty string orproxysysas the password.Then, run the
alter proxyconfig set skip_proxy_sys_private_check = truecommand.The password of the
root@proxysysuser is inconsistent with that stored in obd. In this case, run the preceding command to connect to ODP by using theroot@proxysysuser, and then run thealter proxyconfig set obproxy_sys_password = <obproxy_pwd>command to change the password.You can change the password to an empty string, namely,
obproxy_sys_password = '', or to the same password as that stored in the obd configuration file.
If the issue persists, you can post a question in the Q&A forum on the OceanBase official website. Designated professionals will help you fix the issue.
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'