欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 新闻 > 资讯 > OceanBase 社区版 4.0 离线方式升级bp1至bp2 指南(含避坑总结)

OceanBase 社区版 4.0 离线方式升级bp1至bp2 指南(含避坑总结)

2024/12/21 23:59:02 来源:https://blog.csdn.net/shlei5580/article/details/144374017  浏览:    关键词:OceanBase 社区版 4.0 离线方式升级bp1至bp2 指南(含避坑总结)

注:目前社区版对 4.0 升级 bp1至 bp2也未有完善的文档,本次升级中也是遇到不少坑,写本文也希望对OB感兴趣的可以尝试少些遇坑。

也希望对升级有更好方式建议方式的朋友一起切磋交流,以便再进一步完善升级方案。

第一次做OB的升级,限于自身技术,难免有纰漏,还望对此熟悉的大牛多多指正。

一、概述

OceanBase 数据库和Oracle等数据库类似,在修复某一版本较多的BUG后会发布一个修复已知漏洞的新版本。Oracle数据库会采用RU或PSU的方式发布一些补丁,OceanBase 是以BPXXX的方式发布。

本次安装OceanBase 4.0 集群最初采用的是 beta_bp1版本,在2022年12月15日,OB社区发布了新版的beta_bp2版本,本次尝试采用离线方式通过obd来升级beta_bp1至beta_bp2版本。

本次升级也曾尝试使用obd update方式,但升级遇到问题,最后通过下载最新版的all-in-one(beta_bp2)版本,通过install.sh脚本一步步完成升级。

在升级过程中,特别要注意如果创建了多租户,在设置primary_zone时一定要谨慎,如果这块设置不慎,可能会升级中途失败导致入坑。

另外,根据OB官网介绍,在升级obproxy时,可能会因为一些参数的设置导致升级失败,这点也要特别的注意,本次因为BP1到BP2,obproxy版本未发生改变,可以不进行升级,本文也是教大家如果真要升级obproxy该如何操作。

二、升级流程

2.1、离线升级OBD

2.1 .1 查看当前obd版本
--登陆中控机服务器,查看当前obd版本信息
[admin@obproxy-node ~]$ obd --version
OceanBase Deploy: 1.6.1
REVISION: 87611f942a25880a15d6b2d638044a7d84ddc488
BUILD_BRANCH: HEAD
BUILD_TIME: Nov 18 2022 16:07:36OURCE
Copyright (C) 2021 OceanBase
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
2.1.2 下载最新oceanbase-all-in-one包

登陆 https://open.oceanbase.com/softwareCenter/community 下载最新版本 4.0.0_beta_bp2包 并上传至中控机服务器 admin用户下。

image20221228160811436.png

2.1.3 执行install.sh
-- admin用户,中控机服务器操作
-- 主要如下几步操作
1) 解压oceanbase-all-in-one安装包
2)执行source
3) 执行obd demo
4) 查看obd 版本-- 解压oceanbase-all-in-one最新安装包
[admin@obproxy-node ~]$ cd soft/
[admin@obproxy-node soft]$ tar -zxf oceanbase-all-in-one-4.0.0.0-beta-100120221214162701.el7.x86_64.tar.gz
[admin@obproxy-node soft]$ cd oceanbase-all-in-one/bin
-- 执行install.sh脚本
[admin@obproxy-node bin]$ ./install.sh
name: grafana
version: 7.5.17
release:1
arch: x86_64
md5: 1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6
add /home/admin/soft/oceanbase-all-in-one/rpms/grafana-7.5.17-1.el7.x86_64.rpm to local mirror
name: obagent
version: 1.2.0
release:4.el7
arch: x86_64
md5: 0e8f5ee68c337ea28514c9f3f820ea546227fa7e
add /home/admin/soft/oceanbase-all-in-one/rpms/obagent-1.2.0-4.el7.x86_64.rpm to local mirror
name: obproxy-ce
version: 4.0.0
release:5.el7
arch: x86_64
md5: de53232a951184fad75b15884458d85e31d2f6c3
add /home/admin/soft/oceanbase-all-in-one/rpms/obproxy-ce-4.0.0-5.el7.x86_64.rpm to local mirror
name: oceanbase-ce
version: 4.0.0.0
release:102000032022120718.el7
arch: x86_64
md5: e1c71a4cb252e51f210aae129cee0f09613d42bb
add /home/admin/soft/oceanbase-all-in-one/rpms/oceanbase-ce-4.0.0.0-102000032022120718.el7.x86_64.rpm to local mirror
name: oceanbase-ce-libs
version: 4.0.0.0
release:102000032022120718.el7
arch: x86_64
md5: ae630e9c53aeee1f6a542d9bdee6beefdc9af3ad
add /home/admin/soft/oceanbase-all-in-one/rpms/oceanbase-ce-libs-4.0.0.0-102000032022120718.el7.x86_64.rpm to local mirror
name: prometheus
version: 2.37.1
release:10000102022110211.el7
arch: x86_64
md5: 58913c7606f05feb01bc1c6410346e5fc31cf263
add /home/admin/soft/oceanbase-all-in-one/rpms/prometheus-2.37.1-10000102022110211.el7.x86_64.rpm to local mirror
Disable remote okadd auto set env logic to profile: /home/admin/.bash_profile#####################################################################Install Finished 
=====================================================================
Setup Environment:     source ~/.oceanbase-all-in-one/bin/env.sh 
Quick Start:           obd demo 
More Details:          obd -h 
=====================================================================-- 然后执行 source
[admin@obproxy-node ~]$ source /home/admin/.oceanbase-all-in-one/bin/env.sh-- 执行obd demo
[admin@obproxy-node bin]$ obd demo
Found a higher version
name: oceanbase-ce
version: 4.0.0.0
release:102000032022120718.el7
arch: x86_64
md5: e1c71a4cb252e51f210aae129cee0f09613d42bb
Do you want to use it? [y/n]: y
Package oceanbase-ce-4.0.0.0-102000032022120718.el7 is available.
install grafana-7.5.17 for local ok
install oceanbase-ce-4.0.0.0 for local ok
install obagent-1.2.0 for local ok
install prometheus-2.37.1 for local ok
install obproxy-ce-4.0.0 for local ok
Cluster param config check ok
Open ssh connection ok
Generate grafana configuration ok
Generate observer configuration ok
Generate obagent configuration ok
Generate prometheus configuration ok
Generate obproxy configuration ok
install grafana-7.5.17 for local ok
install oceanbase-ce-4.0.0.0 for local ok
install obagent-1.2.0 for local ok
install prometheus-2.37.1 for local ok
install obproxy-ce-4.0.0 for local ok
+--------------------------------------------------------------------------------------------+
|                                          Packages                                          |
+--------------+---------+------------------------+------------------------------------------+
| Repository   | Version | Release                | Md5                                      |
+--------------+---------+------------------------+------------------------------------------+
| grafana      | 7.5.17  | 1                      | 1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 |
| oceanbase-ce | 4.0.0.0 | 102000032022120718.el7 | e1c71a4cb252e51f210aae129cee0f09613d42bb |
| obagent      | 1.2.0   | 4.el7                  | 0e8f5ee68c337ea28514c9f3f820ea546227fa7e |
| prometheus   | 2.37.1  | 10000102022110211.el7  | 58913c7606f05feb01bc1c6410346e5fc31cf263 |
| obproxy-ce   | 4.0.0   | 5.el7                  | de53232a951184fad75b15884458d85e31d2f6c3 |
+--------------+---------+------------------------+------------------------------------------+
Repository integrity check ok
Parameter check ok
Open ssh connection ok
Cluster status check ok
[ERROR] Some of the servers in the cluster have been started
127.0.0.1 grafana is started
127.0.0.1 prometheus is started
See https://www.oceanbase.com/product/ob-deployer/error-codes .-- 查看obd当前版本
[admin@obproxy-node ~]$ obd --version
OceanBase Deploy: 1.6.2
REVISION: 188385cf71729311c33df8cfa2d9b059ade337fd
BUILD_BRANCH: HEAD
BUILD_TIME: Dec 14 2022 11:34:49OURCE
Copyright (C) 2021 OceanBase
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

2.2 升级OceanBase

2.2.1 禁用远程镜像
-- admin用户,中控机服务器操作
[admin@obproxy-node ~]$ obd mirror disable remote
Disable remote ok
2.2.2 拷贝新版本oceanbase-ce包
-- admin用户,中控机服务器操作
[admin@obproxy-node ~]$ obd mirror clone /home/admin/soft/oceanbase-all-in-one/rpms/oceanbase-ce-4.0.0.0-102000032022120718.el7.x86_64.rpm
mirror oceanbase-ce-4.0.0.0-102000032022120718.el7.x86_64.rpm existed. Do you want to overwrite? [y/n]: y
name: oceanbase-ce
version: 4.0.0.0
release:102000032022120718.el7
arch: x86_64
md5: e1c71a4cb252e51f210aae129cee0f09613d42bb
add /home/admin/soft/oceanbase-all-in-one/rpms/oceanbase-ce-4.0.0.0-102000032022120718.el7.x86_64.rpm to local mirror-- 查看md5值
[admin@obproxy-node ~]$ obd mirror list local
+----------------------------------------------------------------------------------------------------------+
|                                            local Package List                                            |
+-------------------+---------+------------------------+--------+------------------------------------------+
| name              | version | release                | arch   | md5                                      |
+-------------------+---------+------------------------+--------+------------------------------------------+
| oceanbase-ce      | 4.0.0.0 | 100000282022112511.el7 | x86_64 | 75ec57ebe42718b386901357cef1e5d3864748ee |
| oceanbase-ce-libs | 4.0.0.0 | 100000282022112511.el7 | x86_64 | c5f1e971cc335efe36233cae291a170a0f518e19 |
| ob-deploy         | 1.6.2   | 10.el7                 | x86_64 | 4542035d1b1af411c93cfe9f1dd78327c2ea05d4 |
| 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-libs | 4.0.0.0 | 102000032022120718.el7 | x86_64 | ae630e9c53aeee1f6a542d9bdee6beefdc9af3ad |
| prometheus        | 2.37.1  | 10000102022110211.el7  | x86_64 | 58913c7606f05feb01bc1c6410346e5fc31cf263 |
| oceanbase-ce      | 4.0.0.0 | 102000032022120718.el7 | x86_64 | e1c71a4cb252e51f210aae129cee0f09613d42bb |
+-------------------+---------+------------------------+--------+------------------------------------------+
2.2.3 为租户设置primary_zone
[admin@obproxy-node ~]$  obclient -h 10.110.3.152 -uroot@sys#obcluster -pob@Passwd -P2883 -c -A oceanbase
Welcome to the OceanBase.  Commands end with ; or \g.
Your OceanBase connection id is 50
Server version: OceanBase_CE 4.0.0.0 (r102000032022120718-58fdb0ef1a9b589ef05e56c1ede65e951986d996) (Built Dec  7 2022 18:32: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.obclient [oceanbase]> ALTER TENANT obuser PRIMARY_ZONE ='zone2';
Query OK, 0 rows affected (0.249 sec)obclient [oceanbase]> ALTER TENANT obuser PRIMARY_ZONE ='zone1;zone2;zone3';
Query OK, 0 rows affected (0.095 sec)
2.2.4 升级OceanBase
[admin@obproxy-node ~]$ obd cluster upgrade obcluster -c oceanbase-ce -V 4.0.0.0 --usable e1c71a4cb252e51f210aae129cee0f09613d42bb
Get local repositories and plugins ok
Open ssh connection ok
Remote oceanbase-ce-4.0.0.0-102000032022120718.el7-e1c71a4cb252e51f210aae129cee0f09613d42bb repository install ok
Remote oceanbase-ce-4.0.0.0-102000032022120718.el7-e1c71a4cb252e51f210aae129cee0f09613d42bb repository lib check ok
Start observer ok
observer program health check ok
Connect to observer ok
Exec upgrade_checker.py ok
Enable upgrade mode ok
Exec upgrade_pre.py ok
Rotation upgrade ok
upgrade zone "zone1"Remote oceanbase-ce-4.0.0.0-102000032022120718.el7-e1c71a4cb252e51f210aae129cee0f09613d42bb repository lib check ok
Stop observer ok
Start observer ok
observer program health check ok
Connect to observer ok
upgrade zone "zone2"
Remote oceanbase-ce-4.0.0.0-102000032022120718.el7-e1c71a4cb252e51f210aae129cee0f09613d42bb repository install ok
Remote oceanbase-ce-4.0.0.0-102000032022120718.el7-e1c71a4cb252e51f210aae129cee0f09613d42bb repository lib check ok
Stop observer ok
Start observer ok
observer program health check ok
Connect to observer ok
upgrade zone "zone3"
Remote oceanbase-ce-4.0.0.0-102000032022120718.el7-e1c71a4cb252e51f210aae129cee0f09613d42bb repository install ok
Remote oceanbase-ce-4.0.0.0-102000032022120718.el7-e1c71a4cb252e51f210aae129cee0f09613d42bb repository lib check ok
Stop observer ok
Start observer ok
observer program health check ok
Connect to observer ok
Exec upgrade_post.py ok
Disable upgrade mode ok
Root inspection ok
Exec upgrade_post_checker.py ok
Wait for observer init ok
+------------------------------------------------+
|                    observer                    |
+--------------+---------+------+-------+--------+
| ip           | version | port | zone  | status |
+--------------+---------+------+-------+--------+
| 10.110.3.152 | 4.0.0.0 | 2881 | zone1 | ACTIVE |
| 10.110.3.153 | 4.0.0.0 | 2881 | zone2 | ACTIVE |
| 10.110.3.154 | 4.0.0.0 | 2881 | zone3 | ACTIVE |
+--------------+---------+------+-------+--------+
obclient -h10.110.3.152 -P2881 -uroot -pob@Passwd -Doceanbase -A

2.3 升级obproxy

-- admin用户,中控机服务器操作
-- 查询当前md5值
[admin@obproxy-node ~]$ obd mirror list local
+----------------------------------------------------------------------------------------------------------+
|                                            local Package List                                            |
+-------------------+---------+------------------------+--------+------------------------------------------+
| name              | version | release                | arch   | md5                                      |
+-------------------+---------+------------------------+--------+------------------------------------------+
| oceanbase-ce      | 4.0.0.0 | 100000282022112511.el7 | x86_64 | 75ec57ebe42718b386901357cef1e5d3864748ee |
| oceanbase-ce-libs | 4.0.0.0 | 100000282022112511.el7 | x86_64 | c5f1e971cc335efe36233cae291a170a0f518e19 |
| ob-deploy         | 1.6.2   | 10.el7                 | x86_64 | 4542035d1b1af411c93cfe9f1dd78327c2ea05d4 |
| grafana           | 7.5.17  | 1                      | x86_64 | 1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 |
| obagent           | 1.2.0   | 4.el7                  | x86_64 | 0e8f5ee68c337ea28514c9f3f820ea546227fa7e |
| oceanbase-ce-libs | 4.0.0.0 | 102000032022120718.el7 | x86_64 | ae630e9c53aeee1f6a542d9bdee6beefdc9af3ad |
| prometheus        | 2.37.1  | 10000102022110211.el7  | x86_64 | 58913c7606f05feb01bc1c6410346e5fc31cf263 |
| oceanbase-ce      | 4.0.0.0 | 102000032022120718.el7 | x86_64 | e1c71a4cb252e51f210aae129cee0f09613d42bb |
| obproxy-ce        | 4.0.0   | 5.el7                  | x86_64 | de53232a951184fad75b15884458d85e31d2f6c3 |
+-------------------+---------+------------------------+--------+------------------------------------------+-- 升级obproxy
[admin@obproxy-node ~]$ obd cluster upgrade obcluster -c obproxy-ce -V 4.0.0 --usable de53232a951184fad75b15884458d85e31d2f6c3  
Get local repositories and plugins ok
+------------------------------------------------------------------------------------+
|                           Search obproxy-ce 4.0.0 Result                           |
+------------+---------+---------+--------+------------------------------------------+
| name       | version | release | arch   | md5                                      |
+------------+---------+---------+--------+------------------------------------------+
| obproxy-ce | 4.0.0   | 5.el7   | x86_64 | de53232a951184fad75b15884458d85e31d2f6c3 |
+------------+---------+---------+--------+------------------------------------------+
install obproxy-ce-4.0.0 for local ok
The current version is already obproxy-ce-4.0.0-5.el7-de53232a951184fad75b15884458d85e31d2f6c3.
Noting to do.
See https://www.oceanbase.com/product/ob-deployer/error-codes .

根据OceanBase开源社区开发人员反馈,BP1到BP2,obproxy没新版本,可以不用升级,本次只是展示如需升级obproxy该如何升级。

三、附录

在升级过程中也遇到一些问题,因为有些官网资料也没有说明,要靠自己摸索,加上在OB开源社区群里不断的请教,在升级过程中主要遇到如下一些故障。

3.1 obd update提示需root用户

-- admin用户,中控机服务器操作
[admin@obproxy-node ~]$ obd update
[ERROR] To update OBD, you must be a root user.
-- 提示需要使用 root用户-- 当尝试使用root用户执行时报 OBD upgrade plugin not found
[root@obproxy-node ~]# /home/admin/oceanbase-all-in-one/obd/usr/bin/obd update
[ERROR] OBD upgrade plugin not found

因为在安装obd时使用的是admin普通用户安装,未使用root用户,但在执行obd update升级时提示需要root用户,但切换到root用户又提示没有发现obd 升级插件,即便我将admin用户通过sudo方式也同样报错。

最后根据OB社区人员建议,改用下载最新的all-in-one BP2版本安装包,使用里面自带install.sh方式进行升级

3.2 未设置primary_zone导致升级失败

在升级oceanBase前,未给多租户用户设置PRIMARY_ZONE,当执行升级时执行到Exec upgrade_checker.py 该步骤报错,导致执行 obd cluster upgrade obcluster 失败,执行过程及报错信息如下。

如下:
[admin@obproxy-node ~]$ obd mirror disable remote
Disable remote ok
[admin@obproxy-node ~]$ obd mirror clone /home/admin/soft/oceanbase-all-in-one/rpms/oceanbase-ce-4.0.0.0-102000032022120718.el7.x86_64.rpm
mirror oceanbase-ce-4.0.0.0-102000032022120718.el7.x86_64.rpm existed. Do you want to overwrite? [y/n]: y
name: oceanbase-ce
version: 4.0.0.0
release:102000032022120718.el7
arch: x86_64
md5: e1c71a4cb252e51f210aae129cee0f09613d42bb
add /home/admin/soft/oceanbase-all-in-one/rpms/oceanbase-ce-4.0.0.0-102000032022120718.el7.x86_64.rpm to local mirror
[admin@obproxy-node ~]$
[admin@obproxy-node ~]$ obd mirror list local
±---------------------------------------------------------------------------------------------------------+
| local Package List |
±------------------±--------±-----------------------±-------±-----------------------------------------+
| name | version | release | arch | md5 |
±------------------±--------±-----------------------±-------±-----------------------------------------+
| oceanbase-ce | 4.0.0.0 | 100000282022112511.el7 | x86_64 | 75ec57ebe42718b386901357cef1e5d3864748ee |
| oceanbase-ce-libs | 4.0.0.0 | 100000282022112511.el7 | x86_64 | c5f1e971cc335efe36233cae291a170a0f518e19 |
| ob-deploy | 1.6.2 | 10.el7 | x86_64 | 4542035d1b1af411c93cfe9f1dd78327c2ea05d4 |
| 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-libs | 4.0.0.0 | 102000032022120718.el7 | x86_64 | ae630e9c53aeee1f6a542d9bdee6beefdc9af3ad |
| prometheus | 2.37.1 | 10000102022110211.el7 | x86_64 | 58913c7606f05feb01bc1c6410346e5fc31cf263 |
| oceanbase-ce | 4.0.0.0 | 102000032022120718.el7 | x86_64 | e1c71a4cb252e51f210aae129cee0f09613d42bb |
±------------------±--------±-----------------------±-------±-----------------------------------------+[admin@obproxy-node ~]$ obd cluster upgrade obcluster -c oceanbase-ce -V 4.0.0.0 --usable e1c71a4cb252e51f210aae129cee0f09613d42bb
Get local repositories and plugins ok
±----------------------------------------------------------------------------------------------------+
| Search oceanbase-ce 4.0.0.0 Result |
±-------------±--------±-----------------------±-------±-----------------------------------------+
| name | version | release | arch | md5 |
±-------------±--------±-----------------------±-------±-----------------------------------------+
| oceanbase-ce | 4.0.0.0 | 100000282022112511.el7 | x86_64 | 75ec57ebe42718b386901357cef1e5d3864748ee |
| oceanbase-ce | 4.0.0.0 | 102000032022120718.el7 | x86_64 | e1c71a4cb252e51f210aae129cee0f09613d42bb |
±-------------±--------±-----------------------±-------±-----------------------------------------+
install oceanbase-ce-4.0.0.0 for local ok
Open ssh connection ok
Connect to observer ok
±------------------------------------------------------------------------------------------------------------+
| Packages Will Be Used |
±-------------±--------±-----------------------±-------±-----------------------------------------±------+
| name | version | release | arch | md5 | mark |
±-------------±--------±-----------------------±-------±-----------------------------------------±------+
| oceanbase-ce | 4.0.0.0 | 100000282022112511.el7 | x86_64 | 75ec57ebe42718b386901357cef1e5d3864748ee | start |
| oceanbase-ce | 4.0.0.0 | 102000032022120718.el7 | x86_64 | e1c71a4cb252e51f210aae129cee0f09613d42bb | 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
Remote oceanbase-ce-4.0.0.0-102000032022120718.el7-e1c71a4cb252e51f210aae129cee0f09613d42bb repository install ok
Remote oceanbase-ce-4.0.0.0-102000032022120718.el7-e1c71a4cb252e51f210aae129cee0f09613d42bb repository lib check ok
Start observer ok
observer program health check ok
Connect to observer ok
Exec upgrade_checker.py x
See https://www.oceanbase.com/product/ob-deployer/error-codes .-- 报错日志信息如下:
[admin@obproxy-node ~]$ more upgrade_checker.log
[2022-12-28 16:49:13] INFO init.py:1611 parameters from cmd: host=“10.110.3.152”, port=2881, user=“root”, password=“ob@Passwd”, log-file=“upgrade_checker.log”
[2022-12-28 16:49:14] INFO init.py:1611 succeed to execute query: select distinct value from GV$OB_PARAMETERS where name=‘min_observer_version’, rowcount = 1
[2022-12-28 16:49:14] INFO init.py:1611 check observer version success, version = 4.0.0.0
[2022-12-28 16:49:14] INFO init.py:1611 succeed to execute query: select count(1) as unsync_cnt from GV$OB_LOG_STAT where in_sync = ‘NO’, rowcount = 1
[2022-12-28 16:49:14] INFO init.py:1611 check paxos replica success
[2022-12-28 16:49:14] INFO init.py:1611 succeed to execute query: select count(1) as cnt from DBA_OB_TENANT_JOBS where job_status=‘INPROGRESS’ and result_code is null, rowcount = 1
[2022-12-28 16:49:14] INFO init.py:1611 succeed to execute query: select count(1) as rebalance_task_cnt from CDB_OB_LS_REPLICA_TASKS, rowcount = 1
[2022-12-28 16:49:14] INFO init.py:1611 check rebalance task success
[2022-12-28 16:49:14] INFO init.py:1611 succeed to execute query: select count(1) from CDB_OB_MAJOR_COMPACTION where STATUS != ‘IDLE’, rowcount = 1
[2022-12-28 16:49:14] INFO init.py:1611 check cluster status success
[2022-12-28 16:49:14] INFO init.py:1611 succeed to execute query: select count(*) as count from DBA_OB_TENANTS where status != ‘NORMAL’, rowcount = 1
[2022-12-28 16:49:14] INFO init.py:1611 check tenant status success
[2022-12-28 16:49:14] INFO init.py:1611 succeed to execute query: select count(1) from CDB_OB_RESTORE_PROGRESS, rowcount = 1
[2022-12-28 16:49:14] INFO init.py:1611 check restore job success
[2022-12-28 16:49:14] INFO init.py:1611 succeed to execute query: select tenant_name,primary_zone from DBA_OB_TENANTS where tenant_id != 1, rowcount = 2
[2022-12-28 16:49:14] INFO init.py:1611 check tenant primary zone success
[2022-12-28 16:49:14] ERROR init.py:1585 run error
Traceback (most recent call last):
File “/tmp/10.110.3.152:2882_10.110.3.153:2882_10.110.3.154:2882/e1c71a4cb252e51f210aae129cee0f09613d42bb/upgrade_checker.py”, line 406, in do_check
check_fail_list()
File “/tmp/10.110.3.152:2882_10.110.3.153:2882_10.110.3.154:2882/e1c71a4cb252e51f210aae129cee0f09613d42bb/upgrade_checker.py”, line 383, in check_fail_list
raise MyError(error_msg)
MyError: 'upgrade checker failed with 2 reasons: [META$1002 tenant primary zone random before update not allowed] , [obuser tenant primary zone random before update not allowed] ’
[2022-12-28 16:49:14] ERROR init.py:1585 normal error
Traceback (most recent call last):
File “/tmp/10.110.3.152:2882_10.110.3.153:2882_10.110.3.154:2882/e1c71a4cb252e51f210aae129cee0f09613d42bb/upgrade_checker.py”, line 410, in do_check
raise e
MyError: 'upgrade checker failed with 2 reasons: [META$1002 tenant primary zone random before update not allowed] , [obuser tenant primary zone random before update not allowed] ’
[2022-12-28 16:49:14] ERROR init.py:1585 normal error
Traceback (most recent call last):
File “/tmp/10.110.3.152:2882_10.110.3.153:2882_10.110.3.154:2882/e1c71a4cb252e51f210aae129cee0f09613d42bb/upgrade_checker.py”, line 440, in
do_check(host, port, user, password, upgrade_params)
File “/tmp/10.110.3.152:2882_10.110.3.153:2882_10.110.3.154:2882/e1c71a4cb252e51f210aae129cee0f09613d42bb/upgrade_checker.py”, line 419, in do_check
raise e
MyError: 'upgrade checker failed with 2 reasons: [META$1002 tenant primary zone random before update not allowed] , [obuser tenant primary zone random before update not allowed] ’

根据OB社区开发人员解释,在升级前需要为多租户设置primary_zone,如果有多个租户,就要为每个租户设置primary_zone。而且设置primary_zone时要至少设置两个primary_zone,以防止无法进行切换。

当为多租户修改了primary_zone后,再根据 2.2.4 升级OceanBase中的步骤重新执行 obd cluster upgrade obcluster 就可以了。

3.3 其它注意事项

除了以上几点,另外就是在执行命令时,一些细节,比如执行命令里的一些参数,比如usable,以及rpm包的md5值,还有所对应的版本号,比如4.0.0 就不能写成 4.0.0.0,否则升级过程中也会报错。

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com