前提条件: 本地已上传好了 OBD 1.6.2 版本的 rpm 包 ob-deploy-x.x.x-xx.el7.x86_64.rpm 。 1、禁用远程镜像。 [root@xxl ~]# obd mirror disable remote Disable remote ok Trace ID: ebc1498e-2d20-11ef-8479-005056b014c2 If you want to view detailed obd logs, please run: obd display-trace ebc1498e-2d20-11ef-8479-005056b014c2 2、拷贝 OBD 2.9.1-1 版本的 rpm 包到本地镜像库。 [root@xxl ~]# obd mirror clone /root/ob-deploy-2.9.1-1.el7.x86_64.rpm name: ob-deploy version: 2.9.1 release:1.el7 arch: x86_64 md5: 281d24b0a6beffdd9298f64ca455aca669dc8b33 add /root/ob-deploy-2.9.1-1.el7.x86_64.rpm to local mirror 3、开始升级 OBD。(不是root此处需要 sudo 方式执行) [root@xxl ~]# obd update Found a higher version package for OBD name: ob-deploy version: 2.9.1 release:1.el7 arch: x86_64 md5: 281d24b0a6beffdd9298f64ca455aca669dc8b33 Upgrade successful. Current version : 2.9.1 前提条件: 本地已上传好 OceanBase 所需的 4.1.0.2 版本的 rpm 包 oceanbase-ce-4.1.0.2-104010012023100710.el7.x86_64.rpm 。 本地已上传好 OceanBase 所需的 4.2.1.7 版本的 rpm 包 oceanbase-ce-4.2.1.7-104010012023100710.el7.x86_64.rpm 。 4、升级完的 OBD,远程仓库默认是开启状态,需要再次禁用。 [root@xxl ~]# obd mirror disable remote Disable remote ok Trace ID: ebc1498e-2d20-11ef-8479-005056b014c2 If you want to view detailed obd logs, please run: obd display-trace ebc1498e-2d20-11ef-8479-005056b014c2 5、检查参数 vi /etc/sysctl.conf vm.max_map_count = 655360 sysctl -p 6、拷贝 OceanBase 新版本的 rpm 包到本地镜像库。 [root@xxl ~]# obd mirror clone oceanbase-ce-4.1.0.2-104010012023100710.el7.x86_64.rpm name: oceanbase-ce version: 4.1.0.2 release:104010012023100710.el7 arch: x86_64 md5: a29cec0d056c9c8ac02fd41e5fcd405982d7aa82 size: 364517747 add oceanbase-ce-4.1.0.2-104010012023100710.el7.x86_64.rpm to local mirror Trace ID: bf8852a2-2d3b-11ef-85f6-005056b014c2 If you want to view detailed obd logs, please run: obd display-trace bf8852a2-2d3b-11ef-85f6-005056b014c2 [root@xxl ~]# obd mirror clone oceanbase-ce-4.2.1.7-107000162024060611.el7.x86_64.rpm name: oceanbase-ce version: 4.2.1.7 release:107000162024060611.el7 arch: x86_64 md5: f69097e5f6056a0f6949867a799eea3724a905aa size: 452109379 add oceanbase-ce-4.2.1.7-107000162024060611.el7.x86_64.rpm to local mirror Trace ID: f23bbcc6-2d26-11ef-bd10-005056b014c2 If you want to view detailed obd logs, please run: obd display-trace f23bbcc6-2d26-11ef-bd10-005056b014c2 7、查看 md5 值,同版本升级,需要 md5 值做唯一验证。 [root@xxl ~]# obd mirror list local +----------------------------------------------------------------------------------------------------------+ | local Package List | +-------------------+---------+------------------------+--------+------------------------------------------+ | name | version | release | arch | md5 | +-------------------+---------+------------------------+--------+------------------------------------------+ | grafana | 7.5.17 | 1 | x86_64 | 1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 | | obagent | 1.2.0 | 4.el7 | x86_64 | 0e8f5ee68c337ea28514c9f3f820ea546227fa7e | | obproxy-ce | 4.0.0 | 5.el7 | x86_64 | de53232a951184fad75b15884458d85e31d2f6c3 | | oceanbase-ce | 4.0.0.0 | 102000032022120718.el7 | x86_64 | e1c71a4cb252e51f210aae129cee0f09613d42bb | | oceanbase-ce-libs | 4.0.0.0 | 102000032022120718.el7 | x86_64 | ae630e9c53aeee1f6a542d9bdee6beefdc9af3ad | | prometheus | 2.37.1 | 10000102022110211.el7 | x86_64 | 58913c7606f05feb01bc1c6410346e5fc31cf263 | | ob-deploy | 2.9.1 | 1.el7 | x86_64 | 281d24b0a6beffdd9298f64ca455aca669dc8b33 | | oceanbase-ce | 4.2.1.7 | 107000162024060611.el7 | x86_64 | f69097e5f6056a0f6949867a799eea3724a905aa | | oceanbase-ce | 4.1.0.2 | 104010012023100710.el7 | x86_64 | a29cec0d056c9c8ac02fd41e5fcd405982d7aa82 | +-------------------+---------+------------------------+--------+------------------------------------------+ Trace ID: c6f6695c-2d3b-11ef-911f-005056b014c2 If you want to view detailed obd logs, please run: obd display-trace c6f6695c-2d3b-11ef-911f-005056b014c2 8、升级 OceanBase。 [root@xxl ~]# obd cluster upgrade StandAlone -c oceanbase-ce -V 4.1.0.2 Get local repositories and plugins ok +-----------------------------------------------------------------------------------------------------+ | Search oceanbase-ce 4.1.0.2 Result | +--------------+---------+------------------------+--------+------------------------------------------+ | name | version | release | arch | md5 | +--------------+---------+------------------------+--------+------------------------------------------+ | oceanbase-ce | 4.1.0.2 | 104010012023100710.el7 | x86_64 | a29cec0d056c9c8ac02fd41e5fcd405982d7aa82 | +--------------+---------+------------------------+--------+------------------------------------------+ install oceanbase-ce-4.1.0.2 for local ok Open ssh connection ok Cluster status check ok Check before upgrade observer ok Connect to observer 127.0.0.1:3306 ok +-------------------------------------------------------------------------------------------------------------+ | Packages Will Be Used | +--------------+---------+------------------------+--------+------------------------------------------+-------+ | name | version | release | arch | md5 | mark | +--------------+---------+------------------------+--------+------------------------------------------+-------+ | oceanbase-ce | 4.0.0.0 | 102000032022120718.el7 | x86_64 | e1c71a4cb252e51f210aae129cee0f09613d42bb | start | | oceanbase-ce | 4.1.0.2 | 104010012023100710.el7 | x86_64 | a29cec0d056c9c8ac02fd41e5fcd405982d7aa82 | dest | +--------------+---------+------------------------+--------+------------------------------------------+-------+ If you use a non-official release, we cannot guarantee a successful upgrade or technical support when you fail. Make sure that you want to use the above package to upgrade. [y/n]: y Start observer ok observer program health check ok Connect to observer 127.0.0.1:3306 ok Disable DDL ok Exec upgrade_checker.py ok Exec upgrade_pre.py ok Exec upgrade_health_checker.py ok Upgrade ok Exec upgrade_post.py ok Wait for observer init ok +---------------------------------------------+ | observer | +-----------+---------+------+-------+--------+ | ip | version | port | zone | status | +-----------+---------+------+-------+--------+ | 127.0.0.1 | 4.1.0.2 | 3306 | zone1 | ACTIVE | +-----------+---------+------+-------+--------+ obclient -h127.0.0.1 -P3306 -uroot -p'密码' -Doceanbase -A cluster unique id: da140e01-ccdc-5070-9920-7ef387773620-1875ac61851-02000104 Trace ID: dbd0af68-2d3b-11ef-bc03-005056b014c2 If you want to view detailed obd logs, please run: obd display-trace dbd0af68-2d3b-11ef-bc03-005056b014c2 9、登录ob。 [root@xxl ~]# obclient -h127.0.0.1 -P3306 -uroot -p'密码' -Doceanbase -A Welcome to the OceanBase. Commands end with ; or \g. Your OceanBase connection id is 3221487637 Server version: OceanBase_CE 4.1.0.2 (r104010012023100710-c8a22dad9e5992353ca80f62d4027a085d952983) (Built Oct 7 2023 10:45:31) Copyright (c) 2000, 2018, OceanBase and/or its affiliates. All rights reserved. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 10、检查版本。 obclient [oceanbase]> SELECT version(); +------------------------------+ | version() | +------------------------------+ | 5.7.25-OceanBase_CE-v4.1.0.2 | +------------------------------+ 1 row in set (0.003 sec) 11、退出 obclient [oceanbase]> exit 12、升级 OceanBase。 [root@xxl ~]# obd cluster upgrade StandAlone -c oceanbase-ce -V 4.2.1.7 --usable=f69097e5f6056a0f6949867a799eea3724a905aa Get local repositories and plugins ok +-----------------------------------------------------------------------------------------------------+ | Search oceanbase-ce 4.2.1.7 Result | +--------------+---------+------------------------+--------+------------------------------------------+ | name | version | release | arch | md5 | +--------------+---------+------------------------+--------+------------------------------------------+ | oceanbase-ce | 4.2.1.7 | 107000162024060611.el7 | x86_64 | f69097e5f6056a0f6949867a799eea3724a905aa | +--------------+---------+------------------------+--------+------------------------------------------+ Open ssh connection ok Cluster status check ok Check before upgrade observer ok Connect to observer 127.0.0.1:3306 ok +-------------------------------------------------------------------------------------------------------------+ | Packages Will Be Used | +--------------+---------+------------------------+--------+------------------------------------------+-------+ | name | version | release | arch | md5 | mark | +--------------+---------+------------------------+--------+------------------------------------------+-------+ | oceanbase-ce | 4.1.0.2 | 104010012023100710.el7 | x86_64 | a29cec0d056c9c8ac02fd41e5fcd405982d7aa82 | start | | oceanbase-ce | 4.2.1.7 | 107000162024060611.el7 | x86_64 | f69097e5f6056a0f6949867a799eea3724a905aa | dest | +--------------+---------+------------------------+--------+------------------------------------------+-------+ If you use a non-official release, we cannot guarantee a successful upgrade or technical support when you fail. Make sure that you want to use the above package to upgrade. [y/n]: y Start observer ok observer program health check ok Connect to observer 127.0.0.1:3306 ok Exec upgrade_checker.py ok Exec upgrade_pre.py ok Exec upgrade_health_checker.py ok Upgrade ok Exec upgrade_post.py ok Check before upgrade observer ok Connect to observer 127.0.0.1:3306 ok obshell taking over ok Wait for observer init ok +---------------------------------------------+ | observer | +-----------+---------+------+-------+--------+ | ip | version | port | zone | status | +-----------+---------+------+-------+--------+ | 127.0.0.1 | 4.2.1.7 | 3306 | zone1 | ACTIVE | +-----------+---------+------+-------+--------+ obclient -h127.0.0.1 -P3306 -uroot -p'密码' -Doceanbase -A cluster unique id: 0df90fc8-acdf-57af-84c6-f5c9c04aac9e-1875ac61b38-07010204 Trace ID: fa290210-2d3d-11ef-8c2f-005056b014c2 If you want to view detailed obd logs, please run: obd display-trace fa290210-2d3d-11ef-8c2f-005056b014c2 13、登录ob。 [root@xxl ~]# obclient -h127.0.0.1 -P3306 -uroot -p'密码' -Doceanbase -A Welcome to the OceanBase. Commands end with ; or \g. Your OceanBase connection id is 3221487654 Server version: OceanBase_CE 4.2.1.7 (r107000162024060611-69b64b84b656a4cfa126dab60b4e66dc1bc156ca) (Built Jun 6 2024 11:51:48) Copyright (c) 2000, 2018, OceanBase and/or its affiliates. All rights reserved. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 14、检查版本。 obclient [oceanbase]> SELECT version(); +------------------------------+ | version() | +------------------------------+ | 5.7.25-OceanBase_CE-v4.2.1.7 | +------------------------------+ 1 row in set (0.002 sec)