暂无图片
暂无图片
1
暂无图片
暂无图片
暂无图片

社区版OceanBase4.0单机安装升级至OceanBase4.1

原创 Oracle 2023-05-15
1172


1 查看现在的版本

[root@dbserver ~]# obd cluster list +-------------------------------------------------+ | Cluster List | +------+------------------------+-----------------+ | Name | Configuration Path | Status (Cached) | +------+------------------------+-----------------+ | lo | /root/.obd/cluster/lo | stopped | | gra | /root/.obd/cluster/gra | stopped | +------+------------------------+-----------------+

obclient [oceanbase]> select version(); +------------------------------+ | version() | +------------------------------+ | 5.7.25-OceanBase_CE-v4.0.0.0 | +------------------------------+ 1 row in set (0.001 sec)

现在的OceanBase社区版4.0是用4.0 all in one包安装的,安装是用的用户是root,不是ob官方推荐的admin用户。

2 下载安装ob4.1 rpm包

2.1 安装包下载

OceanBase4.1社区版安装包的下载地址是
(https://www.oceanbase.com/softwarecenter)
打开这个地址,显示的下面的下载页面



下载x86版的OceanBase数据库和依赖库包,这里依赖库包也要下载,安装数据库rpm包时会用得到。

2.2 检查升级的前提条件是否满足

OceanBase升级需要在observer节点上安装python2.7,并且需要安装datetime,sys,os,mysql.connector,logging,getopt,time模块
检查python版本

[root@dbserver ~]# python -V Python 2.7.5

检查已经安装的python模块

[root@dbserver bin]# pydoc modules Please wait a moment while I gather a list of all available modules... /usr/lib64/python2.7/site-packages/gobject/constants.py:24: Warning: g_boxed_type_register_static: assertion 'g_type_from_name (name) == 0' failed import gobject._gobject BaseHTTPServer bisect io selinux Bastion bsddb itertools semanage .......

已经安装的模块里缺少mysql.connector模块,从官网上下载并安装

[root@dbserver ~]# rpm -ivh mysql-connector-python-2.1.8-1.el7.x86_64.rpm warning: mysql-connector-python-2.1.8-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ################################# [100%] Updating / installing... 1:mysql-connector-python-2.1.8-1.el################################# [100%]

2.3 安装OceanBase 4.1 rpm包

直接安装OceanBase 4.1数据库包

[root@dbserver ~]# rpm -Uvh oceanbase-ce-4.1.0.0-100000202023040520.el7.x86_64.rpm error: Failed dependencies: libmariadb.so.3()(64bit) is needed by oceanbase-ce-4.1.0.0-100000202023040520.el7.x86_64 libmariadb.so.3(libmysqlclient_18)(64bit) is needed by oceanbase-ce-4.1.0.0-100000202023040520.el7.x86_64

安装失败了,失败的原因是缺少libmariadb依赖包。先安装下载的OceanBase lib rpm包

[root@dbserver ~]# rpm -Uvh oceanbase-ce-libs-4.1.0.0-100000192023032010.el7.x86_64.rpm Preparing... ################################# [100%] Updating / installing... 1:oceanbase-ce-libs-4.1.0.0-1000001warning: user admin does not exist - using root warning: group admin does not exist - using root ################################# [100%]

安装这个包的过程中与警告信息,提示admin用户和组不存在,使用root用户和组。虽然有这个告警信息,安装的进度是100%,显示安装已经完成。现在接着安装数据库包

[root@dbserver ~]# rpm -Uvh oceanbase-ce-4.1.0.0-100000202023040520.el7.x86_64.rpm
warning: group admin does not exist - using root
warning: user admin does not exist - using root
warning: group admin does not exist - using root
################################# [100%]
warning: user admin does not exist - using root

这里出现的告警信息和安装库包时相同,安装进度也是100%。看一下数据库包的安装位置,使用rpm命令的-l选项可以查看rpm包里文件的安装位置。

[root@dbserver ~]# rpm -ql oceanbase-ce-4.1.0.0-100000202023040520.el7.x86_64 /home/admin/oceanbase/admin ....... /home/admin/oceanbase/etc ...... /home/admin/oceanbase/etc/upgrade_checker.py /home/admin/oceanbase/etc/upgrade_health_checker.py /home/admin/oceanbase/etc/upgrade_post.py /home/admin/oceanbase/etc/upgrade_pre.py

虽然系统不存在admin用户,安装时还是创建了/home/admin/目录作为安装目录。

3 升级至OceanBase4.1

3.1 升级前的准备工作

根据官网的升级指南,生产环境中升级需要备份

  • server_permanent_offline_time
  • enable_rebalance
  • enable_rereplication
    这三个配置项的值,用于升级流程完成后进行还原。我这里的单机的测试环境,这个备份可以不做。
    升级前需要做的另一个工作时查看升级路径,进入/home/admin/oceanbase/etc/目录,查看
    oceanbase_upgrade_dep.yml文件,可以看到升级到4.1支持的升级路径

[root@dbserver ~]# cd /home/admin/oceanbase/etc [root@dbserver etc]# cat oceanbase_upgrade_dep.yml

这个文件里可以看到的升级路径只有一个

- version: 4.0.0.0 can_be_upgraded_to: - 4.1.0.0 require_from_binary: value: True when_come_from: [4.0.0.0] - version: 4.1.0.0 require_from_binary: value: True when_come_from: [4.0.0.0, 4.1.0.0]

3.2 升级至OceanBase4.1

3.2.1 运行upgrade_checker.py脚本

这个脚本需要使用root用户登录到OceanBase的sys租户进行相关的检查并设置server_permanent_offline_time的值为72小时,这是这个参数需要备份的原因。

[root@dbserver etc]# python upgrade_checker.py -h 127.0.0.1 -P2881 -uroot@sys -p'lichx123' [2023-05-05 14:16:14] INFO upgrade_checker.py:637 parameters from cmd: host="127.0.0.1", port=2881, user="root@sys", password="lichx123", timeout="0", log-file="upgrade_checker.log" [2023-05-05 14:16:14] INFO upgrade_checker.py:45 succeed to execute query: select distinct value from GV$OB_PARAMETERS where name='min_observer_version', rowcount = 1 [2023-05-05 14:16:14] INFO upgrade_checker.py:325 check observer version success, version = 4.0.0.0 [2023-05-05 14:16:14] INFO upgrade_checker.py:45 succeed to execute query: select distinct value from GV$OB_PARAMETERS where name='min_observer_version', rowcount = 1 [2023-05-05 14:16:14] INFO upgrade_checker.py:45 succeed to execute query: select count(1) as unsync_cnt from GV$OB_LOG_STAT where in_sync = 'NO', rowcount = 1 [2023-05-05 14:16:14] INFO upgrade_checker.py:377 check paxos replica success [2023-05-05 14:16:14] INFO upgrade_checker.py:45 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 [2023-05-05 14:16:14] INFO upgrade_checker.py:45 succeed to execute query: select count(1) as rebalance_task_cnt from CDB_OB_LS_REPLICA_TASKS, rowcount = 1 [2023-05-05 14:16:14] INFO upgrade_checker.py:389 check rebalance task success [2023-05-05 14:16:14] INFO upgrade_checker.py:45 succeed to execute query: select count(1) from CDB_OB_MAJOR_COMPACTION where STATUS != 'IDLE', rowcount = 1 [2023-05-05 14:16:14] INFO upgrade_checker.py:397 check cluster status success [2023-05-05 14:16:14] INFO upgrade_checker.py:45 succeed to execute query: select distinct value from GV$OB_PARAMETERS where name='min_observer_version', rowcount = 1 [2023-05-05 14:16:14] INFO upgrade_checker.py:45 succeed to execute query: select count(*) as count from DBA_OB_TENANTS where status != 'NORMAL', rowcount = 1 [2023-05-05 14:16:14] INFO upgrade_checker.py:418 check tenant status success [2023-05-05 14:16:14] INFO upgrade_checker.py:45 succeed to execute query: select count(*) as count from oceanbase.__all_virtual_tenant_info where tenant_role != 'PRIMARY' , rowcount = 1 [2023-05-05 14:16:14] INFO upgrade_checker.py:432 check tenant info success [2023-05-05 14:16:14] INFO upgrade_checker.py:45 succeed to execute query: select count(1) from CDB_OB_RESTORE_PROGRESS, rowcount = 1 [2023-05-05 14:16:14] INFO upgrade_checker.py:441 check restore job success [2023-05-05 14:16:14] INFO upgrade_checker.py:45 succeed to execute query: select distinct value from GV$OB_PARAMETERS where name='min_observer_version', rowcount = 1 [2023-05-05 14:16:14] INFO upgrade_checker.py:45 succeed to execute query: select tenant_name,primary_zone from DBA_OB_TENANTS where tenant_id != 1, rowcount = 0 [2023-05-05 14:16:14] INFO upgrade_checker.py:476 check tenant primary zone success [2023-05-05 14:16:14] INFO upgrade_checker.py:45 succeed to execute query: select count(1) from __all_virtual_ddl_task_status, rowcount = 1 [2023-05-05 14:16:14] INFO upgrade_checker.py:487 check ddl task execut status success [2023-05-05 14:16:14] INFO upgrade_checker.py:45 succeed to execute query: select count(1) from CDB_OB_BACKUP_JOBS, rowcount = 1 [2023-05-05 14:16:14] INFO upgrade_checker.py:498 check backup job success [2023-05-05 14:16:14] INFO upgrade_checker.py:45 succeed to execute query: select distinct value from GV$OB_PARAMETERS where name='min_observer_version', rowcount = 1 [2023-05-05 14:16:14] INFO upgrade_checker.py:45 succeed to execute query: select count(1) from CDB_OB_ARCHIVELOG where status!='STOP', rowcount = 1 [2023-05-05 14:16:14] INFO upgrade_checker.py:520 check archive job success [2023-05-05 14:16:14] INFO upgrade_checker.py:45 succeed to execute query: select distinct value from GV$OB_PARAMETERS where name='min_observer_version', rowcount = 1 [2023-05-05 14:16:14] INFO upgrade_checker.py:45 succeed to execute query: select count(1) from CDB_OB_ARCHIVE_DEST, rowcount = 1 [2023-05-05 14:16:14] INFO upgrade_checker.py:541 check archive destination success [2023-05-05 14:16:14] INFO upgrade_checker.py:45 succeed to execute query: select distinct value from GV$OB_PARAMETERS where name='min_observer_version', rowcount = 1 [2023-05-05 14:16:14] INFO upgrade_checker.py:45 succeed to execute query: select count(1) from CDB_OB_BACKUP_PARAMETER where name='data_backup_dest' and (value!=NULL or value!=''), rowcount = 1 [2023-05-05 14:16:14] INFO upgrade_checker.py:562 check backup destination success [2023-05-05 14:16:14] INFO upgrade_checker.py:56 alter system set server_permanent_offline_time = '72h' [2023-05-05 14:16:15] INFO upgrade_checker.py:65 select count(*) as cnt from oceanbase.__all_virtual_sys_parameter_stat where name = 'server_permanent_offline_time' and value != '72h' [2023-05-05 14:16:15] INFO upgrade_checker.py:72 server_permanent_offline_time is sync, value is 72h

3.2.2 运行脚本upgrade_pre.py

[root@dbserver etc]# python upgrade_pre.py -h 127.0.0.1 -P2881 -uroot@sys -p'lichx123' succeed to create run dir: upgrade_pre_extract_files_2023_05_05_14_19_05_879808_Ev8VFXNI succeed to split all sub py files [2023-05-05 14:19:05] INFO do_upgrade_pre.py:140 parameters from cmd: host="127.0.0.1", port=2881, user="root@sys", password="lichx123", timeout="0", module="set(['post_check', 'health_check', 'begin_upgrade', 'end_rolling_upgrade', 'begin_rolling_upgrade', 'end_upgrade', 'tenant_upgrade', 'special_action'])", log-file="upgrade_pre.log" [2023-05-05 14:19:05] INFO actions.py:174 select distinct(substring_index(build_version, '_', 1)) from __all_server [2023-05-05 14:19:05] INFO actions.py:180 check server version success [2023-05-05 14:19:05] INFO do_upgrade_pre.py:65 ================begin to run begin upgrade action=============== [2023-05-05 14:19:05] INFO actions.py:186 select * from oceanbase.GV$OB_PARAMETERS where name = 'enable_upgrade_mode' and value = 'True' [2023-05-05 14:19:05] INFO actions.py:225 alter system begin upgrade [2023-05-05 14:19:06] INFO actions.py:202 select count(*) as cnt from oceanbase.GV$OB_PARAMETERS where name = 'enable_upgrade_mode' and value != 'True' [2023-05-05 14:19:06] INFO actions.py:209 enable_upgrade_mode is sync, value is True [2023-05-05 14:19:06] INFO do_upgrade_pre.py:70 ================succeed to run begin upgrade action=============== [2023-05-05 14:19:06] INFO do_upgrade_pre.py:73 ================begin to run begin rolling upgrade action=============== [2023-05-05 14:19:06] INFO actions.py:186 select * from oceanbase.GV$OB_PARAMETERS where name = '_upgrade_stage' and value = 'DBUPGRADE' [2023-05-05 14:19:06] INFO actions.py:241 alter system begin rolling upgrade [2023-05-05 14:19:06] INFO actions.py:202 select count(*) as cnt from oceanbase.GV$OB_PARAMETERS where name = '_upgrade_stage' and value != 'DBUPGRADE' [2023-05-05 14:19:06] INFO actions.py:209 _upgrade_stage is sync, value is DBUPGRADE [2023-05-05 14:19:06] INFO do_upgrade_pre.py:78 ================succeed to run begin rolling upgrade action=============== [2023-05-05 14:19:06] INFO do_upgrade_pre.py:81 ================begin to run special action=============== [2023-05-05 14:19:06] INFO actions.py:446 select distinct value from __all_virtual_sys_parameter_stat where name='min_observer_version' [2023-05-05 14:19:06] INFO actions.py:452 get observer version success, version = 4.0.0.0 [2023-05-05 14:19:06] INFO actions.py:110 alter system set enable_ddl = 'False' [2023-05-05 14:19:06] INFO actions.py:202 select count(*) as cnt from oceanbase.GV$OB_PARAMETERS where name = 'enable_ddl' and value != 'False' [2023-05-05 14:19:06] INFO actions.py:212 enable_ddl is not sync, value should be False [2023-05-05 14:19:11] INFO actions.py:202 select count(*) as cnt from oceanbase.GV$OB_PARAMETERS where name = 'enable_ddl' and value != 'False' [2023-05-05 14:19:11] INFO actions.py:209 enable_ddl is sync, value is False [2023-05-05 14:19:11] INFO actions.py:110 alter system set enable_major_freeze = 'False' [2023-05-05 14:19:11] INFO actions.py:202 select count(*) as cnt from oceanbase.GV$OB_PARAMETERS where name = 'enable_major_freeze' and value != 'False' [2023-05-05 14:19:11] INFO actions.py:209 enable_major_freeze is sync, value is False [2023-05-05 14:19:11] INFO actions.py:110 alter system set enable_rebalance = 'False' [2023-05-05 14:19:11] INFO actions.py:202 select count(*) as cnt from oceanbase.GV$OB_PARAMETERS where name = 'enable_rebalance' and value != 'False' [2023-05-05 14:19:11] INFO actions.py:212 enable_rebalance is not sync, value should be False [2023-05-05 14:19:16] INFO actions.py:202 select count(*) as cnt from oceanbase.GV$OB_PARAMETERS where name = 'enable_rebalance' and value != 'False' [2023-05-05 14:19:16] INFO actions.py:209 enable_rebalance is sync, value is False [2023-05-05 14:19:16] INFO actions.py:110 alter system set enable_rereplication = 'False' [2023-05-05 14:19:16] INFO actions.py:202 select count(*) as cnt from oceanbase.GV$OB_PARAMETERS where name = 'enable_rereplication' and value != 'False' [2023-05-05 14:19:16] INFO actions.py:209 enable_rereplication is sync, value is False [2023-05-05 14:19:16] INFO do_upgrade_pre.py:86 ================succeed to run special action=============== [2023-05-05 14:19:16] INFO do_upgrade_pre.py:89 ================begin to run health check action =============== [2023-05-05 14:19:16] INFO upgrade_health_checker.py:289 zone is empty, check all servers in cluster [2023-05-05 14:19:16] INFO upgrade_health_checker.py:46 succeed to execute query: select count(*) from oceanbase.__all_server where (start_service_time <= 0 or status='inactive'), rowcount = 1 [2023-05-05 14:19:16] INFO upgrade_health_checker.py:333 check value is 0 success [2023-05-05 14:19:16] INFO upgrade_health_checker.py:46 succeed to execute query: select count(*) from GV$OB_LOG_STAT where in_sync = 'NO', rowcount = 1 [2023-05-05 14:19:16] INFO upgrade_health_checker.py:333 check value is 0 success [2023-05-05 14:19:16] INFO upgrade_health_checker.py:311 check paxos replica success [2023-05-05 14:19:16] INFO upgrade_health_checker.py:46 succeed to execute query: select if (a.cnt = b.cnt, 1, 0) as passed from (select count(*) as cnt from oceanbase.__all_virtual_server_schema_info where refreshed_schema_version > 1 and refreshed_schema_version % 8 = 0) as a join (select count(*) as cnt from oceanbase.__all_server join oceanbase.__all_tenant) as b, rowcount = 1 [2023-05-05 14:19:16] INFO upgrade_health_checker.py:333 check value is 1 success [2023-05-05 14:19:16] INFO upgrade_health_checker.py:295 skip check server version by cluster [2023-05-05 14:19:16] INFO do_upgrade_pre.py:91 ================succeed to run health check action =============== [2023-05-05 14:19:16] INFO do_upgrade_pre.py:42 ================================================================================== [2023-05-05 14:19:16] INFO do_upgrade_pre.py:43 ============================== STATISTICS BEGIN ================================== [2023-05-05 14:19:16] INFO do_upgrade_pre.py:44 ================================================================================== [2023-05-05 14:19:16] INFO do_upgrade_pre.py:45 succeed run sql(except sql of special actions): alter system begin upgrade; alter system begin rolling upgrade; [2023-05-05 14:19:16] INFO do_upgrade_pre.py:46 commited sql(except sql of special actions): alter system begin upgrade; alter system begin rolling upgrade; [2023-05-05 14:19:16] INFO do_upgrade_pre.py:47 ================================================================================== [2023-05-05 14:19:16] INFO do_upgrade_pre.py:48 =============================== STATISTICS END =================================== [2023-05-05 14:19:16] INFO do_upgrade_pre.py:49 ==================================================================================

这个脚本执行alter system begin upgrade;
alter system begin rolling upgrade并确认命令执行成功并生效,也检查并更改enable_ddl,enable_major_freeze,enable_rebalance,enable_rereplication值,检查完之后进行集群健康检查,没有报错信息后才能继续进行升级。

3.2.3 集群升级

如果按zone进行升级,每个zone都要运行upgrade_health_checker.py脚本

[root@dbserver etc]# python upgrade_health_checker.py -h 127.0.0.1 -P2881 -uroot@sys -p'lichx123' [2023-05-05 14:22:09] INFO upgrade_health_checker.py:396 parameters from cmd: host="127.0.0.1", port=2881, user="root@sys", password="lichx123", log-file="upgrade_cluster_health_checker.log", timeout=600, zone="" [2023-05-05 14:22:09] INFO upgrade_health_checker.py:289 zone is empty, check all servers in cluster [2023-05-05 14:22:09] INFO upgrade_health_checker.py:46 succeed to execute query: select count(*) from oceanbase.__all_server where (start_service_time <= 0 or status='inactive'), rowcount = 1 [2023-05-05 14:22:09] INFO upgrade_health_checker.py:333 check value is 0 success [2023-05-05 14:22:09] INFO upgrade_health_checker.py:46 succeed to execute query: select count(*) from GV$OB_LOG_STAT where in_sync = 'NO', rowcount = 1 [2023-05-05 14:22:09] INFO upgrade_health_checker.py:333 check value is 0 success [2023-05-05 14:22:09] INFO upgrade_health_checker.py:311 check paxos replica success [2023-05-05 14:22:09] INFO upgrade_health_checker.py:46 succeed to execute query: select if (a.cnt = b.cnt, 1, 0) as passed from (select count(*) as cnt from oceanbase.__all_virtual_server_schema_info where refreshed_schema_version > 1 and refreshed_schema_version % 8 = 0) as a join (select count(*) as cnt from oceanbase.__all_server join oceanbase.__all_tenant) as b, rowcount = 1 [2023-05-05 14:22:09] INFO upgrade_health_checker.py:333 check value is 1 success [2023-05-05 14:22:09] INFO upgrade_health_checker.py:295 skip check server version by cluster

这个是单机安装,只有一个zone。在多个zone是,可以执行滚动升级,不会影响到业务运行,这里只有一个zone,只能停止集群进行升级了。停止集群后,用4.1的observer替换4.0 observer后启动集群就完成升级了

cd /root/observer/bin
rm *
[root@dbserver bin]# cp /home/admin/oceanbase/bin/* .
[root@dbserver bin]# ls
import_time_zone_info.py  observer

替换完成后,启动集群

[root@dbserver bin]# obd cluster start lo Get local repositories ok Search plugins ok Open ssh connection ok Load cluster param plugin ok Check before start observer ok [WARN] OBD-1007: (127.0.0.1) The recommended number of open files is 655350 (Current value: 65536) Start observer ok observer program health check ok Connect to observer ok Initialize cluster ok Wait for observer init ok +---------------------------------------------+ | observer | +-----------+---------+------+-------+--------+ | ip | version | port | zone | status | +-----------+---------+------+-------+--------+ | 127.0.0.1 | 4.0.0.0 | 2881 | zone1 | ACTIVE | +-----------+---------+------+-------+--------+ obclient -h127.0.0.1 -P2881 -uroot -Doceanbase lo running

3.3 升级后检查

升级完成后,登录ob检查现在的版本

[root@dbserver bin]# obclient -h127.0.0.1 -P2881 -uroot@sys -p
Enter password:
Welcome to the OceanBase.  Commands end with ; or \g.
Your OceanBase connection id is 3221487617
Server version: OceanBase_CE 4.1.0.0 (r100000202023040520-0765e69043c31bf86e83b5d618db0530cf31b707) (Built Apr  5 2023 20:26:14)

Copyright (c) 2000, 2018, OB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

obclient [(none)]> select version();
+------------------------------+
| version()                    |
+------------------------------+
| 5.7.25-OceanBase_CE-v4.1.0.0 |
+------------------------------+
1 row in set (0.001 sec)

版本已经升级到4.1.0.0了
运行upgrade_post.py,在升级结束后必须运行这个脚本,这个脚本主要是结束升级及滚动升级。并更改一些选项

[root@dbserver etc]# python upgrade_post.py -h 127.0.0.1 -P2881 -uroot@sys -p'lichx123' succeed to create run dir: upgrade_post_extract_files_2023_05_05_16_02_31_419978_I3BKISJn succeed to split all sub py files [2023-05-05 16:02:31] INFO do_upgrade_post.py:150 parameters from cmd: host="127.0.0.1", port=2881, user="root@sys", password="lichx123", timeout="0", module="set(['post_check', 'health_check', 'begin_upgrade', 'end_rolling_upgrade', 'begin_rolling_upgrade', 'end_upgrade', 'tenant_upgrade', 'special_action'])", log-file="upgrade_post.log" [2023-05-05 16:02:31] INFO actions.py:174 select distinct(substring_index(build_version, '_', 1)) from __all_server [2023-05-05 16:02:31] INFO actions.py:180 check server version success [2023-05-05 16:02:31] INFO do_upgrade_post.py:67 ================begin to run health check action =============== [2023-05-05 16:02:31] INFO upgrade_health_checker.py:289 zone is empty, check all servers in cluster [2023-05-05 16:02:31] INFO upgrade_health_checker.py:46 succeed to execute query: select count(*) from oceanbase.__all_server where (start_service_time <= 0 or status='inactive'), rowcount = 1 [2023-05-05 16:02:31] INFO upgrade_health_checker.py:333 check value is 0 success [2023-05-05 16:02:31] INFO upgrade_health_checker.py:46 succeed to execute query: select count(*) from GV$OB_LOG_STAT where in_sync = 'NO', rowcount = 1 [2023-05-05 16:02:31] INFO upgrade_health_checker.py:333 check value is 0 success [2023-05-05 16:02:31] INFO upgrade_health_checker.py:311 check paxos replica success [2023-05-05 16:02:31] INFO upgrade_health_checker.py:46 succeed to execute query: select if (a.cnt = b.cnt, 1, 0) as passed from (select count(*) as cnt from oceanbase.__all_virtual_server_schema_info where refreshed_schema_version > 1 and refreshed_schema_version % 8 = 0) as a join (select count(*) as cnt from oceanbase.__all_server join oceanbase.__all_tenant) as b, rowcount = 1 [2023-05-05 16:02:31] INFO upgrade_health_checker.py:333 check value is 1 success [2023-05-05 16:02:31] INFO upgrade_health_checker.py:295 skip check server version by cluster [2023-05-05 16:02:31] INFO do_upgrade_post.py:69 ================succeed to run health check action =============== [2023-05-05 16:02:31] INFO do_upgrade_post.py:72 ================begin to run end rolling upgrade action =============== [2023-05-05 16:02:31] INFO actions.py:186 select * from oceanbase.GV$OB_PARAMETERS where name = 'enable_upgrade_mode' and value = 'False' [2023-05-05 16:02:32] INFO actions.py:186 select * from oceanbase.GV$OB_PARAMETERS where name = '_upgrade_stage' and value = 'POSTUPGRADE' [2023-05-05 16:02:32] INFO actions.py:261 alter system end rolling upgrade [2023-05-05 16:02:32] INFO actions.py:202 select count(*) as cnt from oceanbase.GV$OB_PARAMETERS where name = 'min_observer_version' and value != '4.1.0.0' [2023-05-05 16:02:32] INFO actions.py:209 min_observer_version is sync, value is 4.1.0.0 [2023-05-05 16:02:32] INFO actions.py:202 select count(*) as cnt from oceanbase.GV$OB_PARAMETERS where name = '_upgrade_stage' and value != 'POSTUPGRADE' [2023-05-05 16:02:32] INFO actions.py:209 _upgrade_stage is sync, value is POSTUPGRADE [2023-05-05 16:02:32] INFO do_upgrade_post.py:77 ================succeed to run end rolling upgrade action =============== [2023-05-05 16:02:32] INFO do_upgrade_post.py:80 ================begin to run tenant upgrade action =============== [2023-05-05 16:02:32] INFO tenant_upgrade_action.py:58 select count(*) from oceanbase.__all_table where table_name = '__all_virtual_core_table' [2023-05-05 16:02:32] INFO tenant_upgrade_action.py:229 start to run upgrade job, job_name:UPGRADE_ALL [2023-05-05 16:02:32] INFO tenant_upgrade_action.py:58 select job_status from oceanbase.__all_rootservice_job where job_type = 'UPGRADE_ALL' order by job_id desc limit 1 [2023-05-05 16:02:32] INFO tenant_upgrade_action.py:146 upgrade job not created yet, should run upgrade job [2023-05-05 16:02:32] INFO actions.py:124 select value from oceanbase.__all_sys_parameter where name = 'enable_ddl' [2023-05-05 16:02:32] INFO actions.py:202 select count(*) as cnt from oceanbase.GV$OB_PARAMETERS where name = 'enable_ddl' and value != 'False' [2023-05-05 16:02:32] INFO actions.py:209 enable_ddl is sync, value is False [2023-05-05 16:02:32] INFO actions.py:110 alter system set enable_ddl = 'True' [2023-05-05 16:02:33] INFO actions.py:202 select count(*) as cnt from oceanbase.GV$OB_PARAMETERS where name = 'enable_ddl' and value != 'True' [2023-05-05 16:02:33] INFO actions.py:209 enable_ddl is sync, value is True [2023-05-05 16:02:33] INFO actions.py:110 alter system set enable_sys_table_ddl = 'True' [2023-05-05 16:02:33] INFO actions.py:202 select count(*) as cnt from oceanbase.GV$OB_PARAMETERS where name = 'enable_sys_table_ddl' and value != 'True' [2023-05-05 16:02:33] INFO actions.py:209 enable_sys_table_ddl is sync, value is True [2023-05-05 16:02:33] INFO tenant_upgrade_action.py:58 select job_id from oceanbase.__all_rootservice_job order by job_id desc limit 1 [2023-05-05 16:02:33] INFO tenant_upgrade_action.py:130 get max_used_job_id:0 [2023-05-05 16:02:33] INFO tenant_upgrade_action.py:243 alter system run upgrade job 'UPGRADE_ALL' [2023-05-05 16:02:33] INFO tenant_upgrade_action.py:58 select job_status, rs_svr_ip, rs_svr_port, gmt_create from oceanbase.__all_rootservice_job where job_type = 'UPGRADE_ALL' and job_id > 0 order by job_id desc limit 1 [2023-05-05 16:02:33] INFO tenant_upgrade_action.py:178 upgrade job not created yet [2023-05-05 16:02:43] INFO tenant_upgrade_action.py:58 select job_status, rs_svr_ip, rs_svr_port, gmt_create from oceanbase.__all_rootservice_job where job_type = 'UPGRADE_ALL' and job_id > 0 order by job_id desc limit 1 [2023-05-05 16:02:43] INFO tenant_upgrade_action.py:183 upgrade job is still running [2023-05-05 16:02:53] INFO tenant_upgrade_action.py:58 select job_status, rs_svr_ip, rs_svr_port, gmt_create from oceanbase.__all_rootservice_job where job_type = 'UPGRADE_ALL' and job_id > 0 order by job_id desc limit 1 [2023-05-05 16:02:53] INFO tenant_upgrade_action.py:183 upgrade job is still running [2023-05-05 16:03:03] INFO tenant_upgrade_action.py:58 select job_status, rs_svr_ip, rs_svr_port, gmt_create from oceanbase.__all_rootservice_job where job_type = 'UPGRADE_ALL' and job_id > 0 order by job_id desc limit 1 [2023-05-05 16:03:03] INFO tenant_upgrade_action.py:183 upgrade job is still running [2023-05-05 16:03:13] INFO tenant_upgrade_action.py:58 select job_status, rs_svr_ip, rs_svr_port, gmt_create from oceanbase.__all_rootservice_job where job_type = 'UPGRADE_ALL' and job_id > 0 order by job_id desc limit 1 [2023-05-05 16:03:13] INFO tenant_upgrade_action.py:209 execute upgrade job successfully [2023-05-05 16:03:13] INFO actions.py:110 alter system set enable_sys_table_ddl = 'False' [2023-05-05 16:03:14] INFO actions.py:202 select count(*) as cnt from oceanbase.GV$OB_PARAMETERS where name = 'enable_sys_table_ddl' and value != 'False' [2023-05-05 16:03:14] INFO actions.py:209 enable_sys_table_ddl is sync, value is False [2023-05-05 16:03:14] INFO actions.py:110 alter system set enable_ddl = 'False' [2023-05-05 16:03:14] INFO actions.py:202 select count(*) as cnt from oceanbase.GV$OB_PARAMETERS where name = 'enable_ddl' and value != 'False' [2023-05-05 16:03:14] INFO actions.py:209 enable_ddl is sync, value is False [2023-05-05 16:03:14] INFO tenant_upgrade_action.py:255 run upgrade job success, job_name:UPGRADE_ALL [2023-05-05 16:03:14] INFO tenant_upgrade_action.py:27 set @@session.ob_query_timeout = 600000000 [2023-05-05 16:03:14] INFO tenant_upgrade_action.py:30 alter system run job 'root_inspection' [2023-05-05 16:03:15] INFO tenant_upgrade_action.py:33 set @@session.ob_query_timeout = 10000000 [2023-05-05 16:03:15] INFO tenant_upgrade_action.py:44 syslog level before upgrade: ip: 127.0.0.1, port: 2882, value: WDIAG [2023-05-05 16:03:15] INFO do_upgrade_post.py:85 ================succeed to run tenant upgrade action =============== [2023-05-05 16:03:15] INFO do_upgrade_post.py:88 ================begin to run end upgrade action =============== [2023-05-05 16:03:15] INFO actions.py:186 select * from oceanbase.GV$OB_PARAMETERS where name = 'enable_upgrade_mode' and value = 'False' [2023-05-05 16:03:15] INFO actions.py:277 alter system end upgrade [2023-05-05 16:03:15] INFO actions.py:202 select count(*) as cnt from oceanbase.GV$OB_PARAMETERS where name = 'enable_upgrade_mode' and value != 'False' [2023-05-05 16:03:15] INFO actions.py:209 enable_upgrade_mode is sync, value is False [2023-05-05 16:03:15] INFO do_upgrade_post.py:93 ================succeed to run end upgrade action =============== [2023-05-05 16:03:15] INFO do_upgrade_post.py:96 ================begin to run post check action =============== [2023-05-05 16:03:15] INFO actions.py:202 select count(*) as cnt from oceanbase.GV$OB_PARAMETERS where name = 'min_observer_version' and value != '4.1.0.0' [2023-05-05 16:03:15] INFO actions.py:209 min_observer_version is sync, value is 4.1.0.0 [2023-05-05 16:03:15] INFO actions.py:309 succeed to execute query: select tenant_id from oceanbase.__all_tenant except select tenant_id from oceanbase.__all_virtual_tenant_info where tenant_role = 'STANDBY', rowcount = 1 [2023-05-05 16:03:15] INFO actions.py:309 succeed to execute query: select count(*) from oceanbase.__all_server, rowcount = 1 [2023-05-05 16:03:15] INFO upgrade_post_checker.py:47 select count(*) as cnt from oceanbase.__all_virtual_tenant_parameter_info where name = 'compatible' and value = '4.1.0.0' and tenant_id in (1) [2023-05-05 16:03:15] INFO upgrade_post_checker.py:54 'compatible' is sync, value is 4.1.0.0 [2023-05-05 16:03:15] INFO actions.py:309 succeed to execute query: select count(*) from __all_virtual_core_table where column_name in ('target_data_version', 'current_data_version') and column_value = 17179934720 and tenant_id in (1), rowcount = 1 [2023-05-05 16:03:15] INFO upgrade_post_checker.py:76 all tenant's target_data_version/current_data_version are match with 4.1.0.0 [2023-05-05 16:03:15] INFO actions.py:309 succeed to execute query: select count(*) from oceanbase.__all_virtual_upgrade_inspection where info != 'succeed', rowcount = 1 [2023-05-05 16:03:15] INFO upgrade_post_checker.py:91 check root inspection success [2023-05-05 16:03:15] INFO actions.py:110 alter system set enable_ddl = 'True' [2023-05-05 16:03:15] INFO actions.py:202 select count(*) as cnt from oceanbase.GV$OB_PARAMETERS where name = 'enable_ddl' and value != 'True' [2023-05-05 16:03:15] INFO actions.py:209 enable_ddl is sync, value is True [2023-05-05 16:03:15] INFO actions.py:110 alter system set enable_rebalance = 'True' [2023-05-05 16:03:15] INFO actions.py:202 select count(*) as cnt from oceanbase.GV$OB_PARAMETERS where name = 'enable_rebalance' and value != 'True' [2023-05-05 16:03:16] INFO actions.py:209 enable_rebalance is sync, value is True [2023-05-05 16:03:16] INFO actions.py:110 alter system set enable_rereplication = 'True' [2023-05-05 16:03:16] INFO actions.py:202 select count(*) as cnt from oceanbase.GV$OB_PARAMETERS where name = 'enable_rereplication' and value != 'True' [2023-05-05 16:03:16] INFO actions.py:209 enable_rereplication is sync, value is True [2023-05-05 16:03:16] INFO actions.py:110 alter system set enable_major_freeze = 'True' [2023-05-05 16:03:16] INFO actions.py:202 select count(*) as cnt from oceanbase.GV$OB_PARAMETERS where name = 'enable_major_freeze' and value != 'True' [2023-05-05 16:03:16] INFO actions.py:212 enable_major_freeze is not sync, value should be True [2023-05-05 16:03:21] INFO actions.py:202 select count(*) as cnt from oceanbase.GV$OB_PARAMETERS where name = 'enable_major_freeze' and value != 'True' [2023-05-05 16:03:21] INFO actions.py:209 enable_major_freeze is sync, value is True [2023-05-05 16:03:21] INFO do_upgrade_post.py:101 ================succeed to run post check action =============== [2023-05-05 16:03:21] INFO do_upgrade_post.py:43 ================================================================================== [2023-05-05 16:03:21] INFO do_upgrade_post.py:44 ============================== STATISTICS BEGIN ================================== [2023-05-05 16:03:21] INFO do_upgrade_post.py:45 ================================================================================== [2023-05-05 16:03:21] INFO do_upgrade_post.py:46 succeed run sql(except sql of special actions): alter system end rolling upgrade; alter system end upgrade; [2023-05-05 16:03:21] INFO do_upgrade_post.py:47 commited sql(except sql of special actions): alter system end rolling upgrade; alter system end upgrade; [2023-05-05 16:03:21] INFO do_upgrade_post.py:48 ================================================================================== [2023-05-05 16:03:21] INFO do_upgrade_post.py:49 =============================== STATISTICS END =================================== [2023-05-05 16:03:21] INFO do_upgrade_post.py:50 ==================================================================================

4 总结

Ocean Base社区版由4.0升级至4.1的操作还是比较简单的,状态的检查、升级的启停,参数的修改都由python脚本来完成。要注意的是,升级结束后一定要执行upgrade_post.py脚本。

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论