上一篇文章介绍了OB集群副本的降级,从5副本1-1-1-1-1架构降级为3副本1-1-1架构,详见OceanBase 2.2集群实战第十四篇—— OB集群【副本降级】
本篇实操OB集群副本的升级,从3副本1-1-1架构升级为5副本1-1-1-1-1架构。
OB解决方案架构师梅老师之前有介绍过OB副本数的调整,文章详见:OceanBase 独立部署高级玩法三:副本数调整
本篇 OB 集群资源规划采用的是不同 ZONE 使用同等规格的机器和资源池配置。
本系列总的专栏:一步一步学习OceanBase系列
OB集群副本升级步骤:
(1). 为 OB 集群增加新的ZONE: zone4 , zone5 ,命令 add zone。
alter system add zone 'zone4';
alter system add zone 'zone5';
alter system start zone 'zone4';
alter system start zone 'zone5';
复制
注意:新增zone后,zone状态是inactive,需要start zone,zone状态是active时才能add server。
(2). 新的observer机器上启动observer进程,分别指定ZONE为: zone4,zone5 。
(3). 给 zone4,zone5 分别增加对应的observer机器,命令 add server 。
alter system add server '192.168.0.30:2882' zone 'zone4';
alter system add server '192.168.0.58:2882' zone 'zone5';
复制
(4). 为每个租户在新zone上分别准备对应的资源池,包括业务租户和sys租户。命令:create resource pool 。
注意:这里不能对新增加的zone直接修改资源池的zone_list,因为新zone不支持,否则会报如下错误:
obclient> alter resource pool mysql_test_pool zone_list = ('zone1','zone2','zone3','zone4','zone5');
ERROR 1235 (0A000): alter resurce pool zone list with a new zone not supported
obclient>
复制
只能创建新的资源池,指定规格和原来的规格一致,新资源池zone_list为新的zone,并修改租户的resource_pool_list,命令如下:
create resource pool new_mysql_test_pool unit = 'my_unit_1c1g', unit_num = 1, zone_list=('zone4','zone5');
create resource pool new_ora_test_pool unit = 'my_unit_1c1g', unit_num = 1, zone_list=('zone4','zone5');
create resource pool new_sys_pool unit = 'sys_unit_config', unit_num = 1, zone_list=('zone4','zone5');
alter tenant mysql_test_tent resource_pool_list=('mysql_test_pool','new_mysql_test_pool');
alter tenant ora_test_tent resource_pool_list=('ora_test_pool','new_ora_test_pool');
alter tenant sys resource_pool_list=('sys_pool','new_sys_pool');
复制
(5). 调整每个租户副本数,修改租户的 locality。此时 OB 内部自动在目标 zone4 和 zone5 添加新的副本。
alter tenant mysql_test_tent locality='FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3, FULL{1}@zone4, FULL{1}@zone5';
alter tenant ora_test_tent locality='FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3, FULL{1}@zone4, FULL{1}@zone5';
alter tenant sys locality='FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3, FULL{1}@zone4, FULL{1}@zone5';
复制
(6). 调整复制表的副本数,修改租户里的复制表的 locality ,增加 zone4 和 zone5 。
alter table test_full locality='F,R{all_server}@zone1, F,R{all_server}@zone2, F,R{all_server}@zone3, F,R{all_server}@zone4, F,R{all_server}@zone5';
复制
以下是整个副本升级实操体验:
1、手动搭建一个2c8g版的1-1-1的OB集群,即两地三中心,三个zone
节点信息:2cpu+8g内存
zone1 ob01: 192.168.0.175
zone2 ob02: 192.168.0.119
zone3 ob03: 192.168.0.221
连接集群,查看集群信息:
除sys系统租户外,有两个业务租户,分别是mysql类型租户和oracle类型的租户,使用相同规格1c1g的资源池配置。
并且在两个业务租户下,创建业务表,一个是非分区表test,一个是分区表test_hash(partition 5),一个是复制表test_full。
如下:
[admin@ob-docker my]$ obclient -h127.1 -P2883 -uroot@sys#obdemo -padmin123 -c -A oceanbase
obclient: [Warning] Using a password on the command line interface can be insecure.
Welcome to the OceanBase monitor. Commands end with ; or \g.
Your OceanBase connection id is 184
Server version: 5.6.25 OceanBase 2.2.50 (r1-1c6441e8fb858c80da395f934f67ed305425864e) (Built Mar 6 2020 18:41:01)
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
obclient> select * from __all_cluster\G
*************************** 1. row ***************************
gmt_create: 2021-03-23 11:05:26.189773
gmt_modified: 2021-03-23 15:53:11.023232
cluster_idx: 0
cluster_id: 20210323
cluster_name: obdemo
rs_list: {"Data":{"ObRegion":"obdemo","ObCluster":"obdemo","ObRegionId":20210323,"ObClusterId":20210323,"Type":"PRIMARY","timestamp":1616485991022973,"RsList":[{"address":"192.168.0.175:2882","role":"LEADER","sql_port":2881},{"ad
dress":"192.168.0.119:2882","role":"FOLLOWER","sql_port":2881},{"address":"192.168.0.221:2882","role":"FOLLOWER","sql_port":2881}],"ReadonlyRsList":[]}}cluster_status: 1
1 row in set (0.02 sec)
obclient> select * from __all_zone;
+----------------------------+----------------------------+-------+--------------------------+------------------+----------------+
| gmt_create | gmt_modified | zone | name | value | info |
+----------------------------+----------------------------+-------+--------------------------+------------------+----------------+
| 2021-03-23 11:05:15.877798 | 2021-03-23 11:05:15.877798 | | cluster | 0 | obdemo |
| 2021-03-23 11:05:15.878575 | 2021-03-23 15:53:10.982389 | | config_version | 1616485990956854 | |
| 2021-03-23 11:05:15.878387 | 2021-03-23 15:37:12.112042 | | frozen_time | 1616485041674255 | |
| 2021-03-23 11:05:15.878316 | 2021-03-23 15:37:12.111787 | | frozen_version | 2 | |
| 2021-03-23 11:05:15.878948 | 2021-03-23 11:05:15.878948 | | gc_schema_version | 0 | |
| 2021-03-23 11:05:15.878437 | 2021-03-23 15:37:31.695947 | | global_broadcast_version | 2 | |
| 2021-03-23 11:05:15.878669 | 2021-03-23 11:05:15.878669 | | is_merge_error | 0 | |
| 2021-03-23 11:05:15.878484 | 2021-03-23 15:38:51.888516 | | last_merged_version | 2 | |
| 2021-03-23 11:05:15.878621 | 2021-03-23 15:53:10.982593 | | lease_info_version | 1616485990982059 | |
| 2021-03-23 11:05:15.878719 | 2021-03-23 15:38:51.889419 | | merge_status | 0 | IDLE |
| 2021-03-23 11:05:15.878530 | 2021-03-23 11:05:15.878530 | | privilege_version | 0 | |
| 2021-03-23 11:05:15.878858 | 2021-03-23 11:05:15.878858 | | proposal_frozen_version | 1 | |
| 2021-03-23 11:05:15.878903 | 2021-03-23 11:05:15.878903 | | snapshot_gc_ts | 0 | |
| 2021-03-23 11:05:15.878994 | 2021-03-23 11:05:15.878994 | | storage_format_version | 3 | |
| 2021-03-23 11:05:15.878812 | 2021-03-23 11:05:15.878812 | | time_zone_info_version | 0 | |
| 2021-03-23 11:05:15.878236 | 2021-03-23 11:05:15.878236 | | try_frozen_version | 1 | |
| 2021-03-23 11:05:15.878767 | 2021-03-23 11:05:15.878767 | | warm_up_start_time | 0 | |
| 2021-03-23 11:05:15.879309 | 2021-03-23 15:38:41.681707 | zone1 | all_merged_version | 2 | |
| 2021-03-23 11:05:15.879151 | 2021-03-23 15:37:31.857543 | zone1 | broadcast_version | 2 | |
| 2021-03-23 11:05:15.879604 | 2021-03-23 11:05:15.879604 | zone1 | idc | 0 | |
| 2021-03-23 11:05:15.879408 | 2021-03-23 15:38:41.681549 | zone1 | is_merge_timeout | 0 | |
| 2021-03-23 11:05:15.879101 | 2021-03-23 15:38:41.680917 | zone1 | is_merging | 0 | |
| 2021-03-23 11:05:15.879249 | 2021-03-23 15:38:41.681384 | zone1 | last_merged_time | 1616485121680330 | |
| 2021-03-23 11:05:15.879198 | 2021-03-23 15:38:41.681172 | zone1 | last_merged_version | 2 | |
| 2021-03-23 11:05:15.879361 | 2021-03-23 15:37:31.857698 | zone1 | merge_start_time | 1616485051856982 | |
| 2021-03-23 11:05:15.879499 | 2021-03-23 15:38:41.681996 | zone1 | merge_status | 0 | IDLE |
| 2021-03-23 11:05:15.879545 | 2021-03-23 11:05:15.879545 | zone1 | region | 0 | default_region |
| 2021-03-23 11:05:15.879043 | 2021-03-23 11:05:15.879043 | zone1 | status | 2 | ACTIVE |
| 2021-03-23 11:05:15.879453 | 2021-03-23 11:05:15.879453 | zone1 | suspend_merging | 0 | |
| 2021-03-23 11:05:15.879651 | 2021-03-23 11:05:15.879651 | zone1 | zone_type | 0 | ReadWrite |
| 2021-03-23 11:05:15.879929 | 2021-03-23 15:38:24.869439 | zone2 | all_merged_version | 2 | |
| 2021-03-23 11:05:15.879792 | 2021-03-23 15:37:31.862186 | zone2 | broadcast_version | 2 | |
| 2021-03-23 11:05:15.880216 | 2021-03-23 11:05:15.880216 | zone2 | idc | 0 | |
| 2021-03-23 11:05:15.880020 | 2021-03-23 15:38:24.869305 | zone2 | is_merge_timeout | 0 | |
| 2021-03-23 11:05:15.879744 | 2021-03-23 15:38:24.868828 | zone2 | is_merging | 0 | |
| 2021-03-23 11:05:15.879884 | 2021-03-23 15:38:24.869175 | zone2 | last_merged_time | 1616485104868423 | |
| 2021-03-23 11:05:15.879839 | 2021-03-23 15:38:24.869034 | zone2 | last_merged_version | 2 | |
| 2021-03-23 11:05:15.879974 | 2021-03-23 15:37:31.862322 | zone2 | merge_start_time | 1616485051861712 | |
| 2021-03-23 11:05:15.880124 | 2021-03-23 15:38:24.869676 | zone2 | merge_status | 0 | IDLE |
| 2021-03-23 11:05:15.880171 | 2021-03-23 11:05:15.880171 | zone2 | region | 0 | default_region |
| 2021-03-23 11:05:15.879698 | 2021-03-23 11:05:15.879698 | zone2 | status | 2 | ACTIVE |
| 2021-03-23 11:05:15.880064 | 2021-03-23 11:05:15.880064 | zone2 | suspend_merging | 0 | |
| 2021-03-23 11:05:15.880261 | 2021-03-23 11:05:15.880261 | zone2 | zone_type | 0 | ReadWrite |
| 2021-03-23 11:05:15.880563 | 2021-03-23 15:38:31.288313 | zone3 | all_merged_version | 2 | |
| 2021-03-23 11:05:15.880427 | 2021-03-23 15:37:31.865814 | zone3 | broadcast_version | 2 | |
| 2021-03-23 11:05:15.880837 | 2021-03-23 11:05:15.880837 | zone3 | idc | 0 | |
| 2021-03-23 11:05:15.880653 | 2021-03-23 15:38:31.288182 | zone3 | is_merge_timeout | 0 | |
| 2021-03-23 11:05:15.880381 | 2021-03-23 15:38:31.287713 | zone3 | is_merging | 0 | |
| 2021-03-23 11:05:15.880518 | 2021-03-23 15:38:31.288071 | zone3 | last_merged_time | 1616485111287321 | |
| 2021-03-23 11:05:15.880473 | 2021-03-23 15:38:31.287932 | zone3 | last_merged_version | 2 | |
| 2021-03-23 11:05:15.880608 | 2021-03-23 15:37:31.865929 | zone3 | merge_start_time | 1616485051865306 | |
| 2021-03-23 11:05:15.880743 | 2021-03-23 15:38:31.288524 | zone3 | merge_status | 0 | IDLE |
| 2021-03-23 11:05:15.880788 | 2021-03-23 11:05:15.880788 | zone3 | region | 0 | default_region |
| 2021-03-23 11:05:15.880329 | 2021-03-23 11:05:15.880329 | zone3 | status | 2 | ACTIVE |
| 2021-03-23 11:05:15.880698 | 2021-03-23 11:05:15.880698 | zone3 | suspend_merging | 0 | |
| 2021-03-23 11:05:15.880883 | 2021-03-23 11:05:15.880883 | zone3 | zone_type | 0 | ReadWrite |
+----------------------------+----------------------------+-------+--------------------------+------------------+----------------+
56 rows in set (0.00 sec)
obclient> source servers.sql
+-------+---------------+----------+------------+-----------------+--------+----------------------------+----------------------------+---------------+
| zone | svr_ip | svr_port | inner_port | with_rootserver | status | gmt_create | start_service_time | build_version |
+-------+---------------+----------+------------+-----------------+--------+----------------------------+----------------------------+---------------+
| zone1 | 192.168.0.175 | 2882 | 2881 | 1 | active | 2021-03-23 11:05:05.341939 | 2021-03-23 15:52:44.897894 | 2.2.50_1 |
| zone2 | 192.168.0.119 | 2882 | 2881 | 0 | active | 2021-03-23 11:05:04.434825 | 2021-03-23 15:52:46.224564 | 2.2.50_1 |
| zone3 | 192.168.0.221 | 2882 | 2881 | 0 | active | 2021-03-23 11:05:04.586951 | 2021-03-23 15:52:46.967032 | 2.2.50_1 |
+-------+---------------+----------+------------+-----------------+--------+----------------------------+----------------------------+---------------+
3 rows in set (0.00 sec)
obclient> source server_stat.sql
+-------+--------------------+-----------+----------+--------------+-------------+---------------+----------+----------------------------+----------+--------+
| zone | observer | cpu_total | cpu_free | mem_total_gb | mem_free_gb | disk_total_gb | unit_num | start_service_time | version | status |
+-------+--------------------+-----------+----------+--------------+-------------+---------------+----------+----------------------------+----------+--------+
| zone1 | 192.168.0.175:2882 | 14 | 9.5 | 3 | 0 | 40 | 3 | 2021-03-23 15:52:44.897894 | 2.2.50_1 | active |
| zone2 | 192.168.0.119:2882 | 14 | 9.5 | 3 | 0 | 40 | 3 | 2021-03-23 15:52:46.224564 | 2.2.50_1 | active |
| zone3 | 192.168.0.221:2882 | 14 | 9.5 | 3 | 0 | 40 | 3 | 2021-03-23 15:52:46.967032 | 2.2.50_1 | active |
+-------+--------------------+-----------+----------+--------------+-------------+---------------+----------+----------------------------+----------+--------+
3 rows in set (0.08 sec)
obclient> source tent.sql
+-----------+-----------------+--------------------+-------------------+---------------------------------------------+-------------------+----------------------------+
| tenant_id | tenant_name | compatibility_mode | zone_list | locality | primary_zone | gmt_modified |
+-----------+-----------------+--------------------+-------------------+---------------------------------------------+-------------------+----------------------------+
| 1 | sys | 0 | zone1;zone2;zone3 | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3 | zone1;zone2,zone3 | 2021-03-23 12:11:27.814891 |
| 1001 | mysql_test_tent | 0 | zone1;zone2;zone3 | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3 | RANDOM | 2021-03-23 12:14:12.333276 |
| 1002 | ora_test_tent | 1 | zone1;zone2;zone3 | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3 | RANDOM | 2021-03-23 12:00:18.492501 |
+-----------+-----------------+--------------------+-------------------+---------------------------------------------+-------------------+----------------------------+
3 rows in set (0.02 sec)
obclient> source pool.sql
+--------------------+------------------+---------+---------+------------+------------+---------+-------+--------------------+-----------+-----------------+
| resource_pool_name | unit_config_name | max_cpu | min_cpu | max_mem_gb | min_mem_gb | unit_id | zone | observer | tenant_id | tenant_name |
+--------------------+------------------+---------+---------+------------+------------+---------+-------+--------------------+-----------+-----------------+
| sys_pool | sys_unit_config | 5 | 2.5 | 1 | 1 | 1 | zone1 | 192.168.0.175:2882 | 1 | sys |
| sys_pool | sys_unit_config | 5 | 2.5 | 1 | 1 | 2 | zone2 | 192.168.0.119:2882 | 1 | sys |
| sys_pool | sys_unit_config | 5 | 2.5 | 1 | 1 | 3 | zone3 | 192.168.0.221:2882 | 1 | sys |
| mysql_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1001 | zone1 | 192.168.0.175:2882 | 1001 | mysql_test_tent |
| mysql_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1002 | zone2 | 192.168.0.119:2882 | 1001 | mysql_test_tent |
| mysql_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1003 | zone3 | 192.168.0.221:2882 | 1001 | mysql_test_tent |
| ora_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1006 | zone1 | 192.168.0.175:2882 | 1002 | ora_test_tent |
| ora_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1007 | zone2 | 192.168.0.119:2882 | 1002 | ora_test_tent |
| ora_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1008 | zone3 | 192.168.0.221:2882 | 1002 | ora_test_tent |
+--------------------+------------------+---------+---------+------------+------------+---------+-------+--------------------+-----------+-----------------+
9 rows in set (0.01 sec)
obclient> source unit_config.sql
+----------------+-----------------+---------+---------+------------+------------+------------------+
| unit_config_id | name | max_cpu | min_cpu | max_mem_gb | min_mem_gb | max_disk_size_gb |
+----------------+-----------------+---------+---------+------------+------------+------------------+
| 1 | sys_unit_config | 5 | 2.5 | 1 | 1 | 40 |
| 1001 | my_unit_1c1g | 1 | 1 | 1 | 1 | 20 |
+----------------+-----------------+---------+---------+------------+------------+------------------+
2 rows in set (0.00 sec)
obclient> source part.sql
+-----------+-----------------+---------------+------------------+------------+---------------+----------+--------------+-------+---------------+----------+------+--------------+
| tenant_id | tenant_name | database_name | table_id | table_Name | tablegroup_id | part_num | partition_Id | zone | svr_ip | svr_port | role | data_size_mb |
+-----------+-----------------+---------------+------------------+------------+---------------+----------+--------------+-------+---------------+----------+------+--------------+
| 1001 | mysql_test_tent | testdb | 1100611139453777 | test | -1 | 1 | 0 | zone3 | 192.168.0.221 | 2882 | 1 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453777 | test | -1 | 1 | 0 | zone1 | 192.168.0.175 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453777 | test | -1 | 1 | 0 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453779 | test_full | -1 | 1 | 0 | zone1 | 192.168.0.175 | 2882 | 1 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453779 | test_full | -1 | 1 | 0 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453779 | test_full | -1 | 1 | 0 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 0 | zone1 | 192.168.0.175 | 2882 | 1 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 0 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 0 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 1 | zone2 | 192.168.0.119 | 2882 | 1 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 1 | zone1 | 192.168.0.175 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 1 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 2 | zone1 | 192.168.0.175 | 2882 | 1 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 2 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 2 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 3 | zone2 | 192.168.0.119 | 2882 | 1 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 3 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 3 | zone1 | 192.168.0.175 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 4 | zone3 | 192.168.0.221 | 2882 | 1 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 4 | zone1 | 192.168.0.175 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 4 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081553 | TEST | -1 | 1 | 0 | zone2 | 192.168.0.119 | 2882 | 1 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081553 | TEST | -1 | 1 | 0 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081553 | TEST | -1 | 1 | 0 | zone1 | 192.168.0.175 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081555 | TEST_FULL | -1 | 1 | 0 | zone1 | 192.168.0.175 | 2882 | 1 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081555 | TEST_FULL | -1 | 1 | 0 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081555 | TEST_FULL | -1 | 1 | 0 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 0 | zone2 | 192.168.0.119 | 2882 | 1 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 0 | zone1 | 192.168.0.175 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 0 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 1 | zone3 | 192.168.0.221 | 2882 | 1 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 1 | zone1 | 192.168.0.175 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 1 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 2 | zone1 | 192.168.0.175 | 2882 | 1 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 2 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 2 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 3 | zone2 | 192.168.0.119 | 2882 | 1 | 0 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 3 | zone1 | 192.168.0.175 | 2882 | 2 | 0 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 3 | zone3 | 192.168.0.221 | 2882 | 2 | 0 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 4 | zone1 | 192.168.0.175 | 2882 | 1 | 0 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 4 | zone2 | 192.168.0.119 | 2882 | 2 | 0 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 4 | zone3 | 192.168.0.221 | 2882 | 2 | 0 |
+-----------+-----------------+---------------+------------------+------------+---------------+----------+--------------+-------+---------------+----------+------+--------------+
42 rows in set (0.34 sec)
obclient>
好了,准备工作已完成,下面开始增加zone副本,从两地三中心架构改为三地五中心架构。
准备新加两个zone,每个zone一台Observer
zone4 ob04 : 192.168.0.30
zone5 ob05 : 192.168.0.58
OB集群从 3 副本升级为 5 副本,步骤如下:
(1). 为 OB 集群增加新的ZONE: zone4 , zone5 。命令 add zone 。
alter system add zone 'zone4';
alter system add zone 'zone5';
alter system start zone 'zone4';
alter system start zone 'zone5';
注意:新增zone后,zone状态是inactive,需要start zone,zone状态是active时才能add server。
示例如下:
obclient> select * from __all_zone;
+----------------------------+----------------------------+-------+--------------------------+------------------+----------------+
| gmt_create | gmt_modified | zone | name | value | info |
+----------------------------+----------------------------+-------+--------------------------+------------------+----------------+
| 2021-03-23 11:05:15.877798 | 2021-03-23 11:05:15.877798 | | cluster | 0 | obdemo |
| 2021-03-23 11:05:15.878575 | 2021-03-23 15:53:10.982389 | | config_version | 1616485990956854 | |
| 2021-03-23 11:05:15.878387 | 2021-03-23 15:37:12.112042 | | frozen_time | 1616485041674255 | |
| 2021-03-23 11:05:15.878316 | 2021-03-23 15:37:12.111787 | | frozen_version | 2 | |
| 2021-03-23 11:05:15.878948 | 2021-03-23 11:05:15.878948 | | gc_schema_version | 0 | |
| 2021-03-23 11:05:15.878437 | 2021-03-23 15:37:31.695947 | | global_broadcast_version | 2 | |
| 2021-03-23 11:05:15.878669 | 2021-03-23 11:05:15.878669 | | is_merge_error | 0 | |
| 2021-03-23 11:05:15.878484 | 2021-03-23 15:38:51.888516 | | last_merged_version | 2 | |
| 2021-03-23 11:05:15.878621 | 2021-03-23 15:53:10.982593 | | lease_info_version | 1616485990982059 | |
| 2021-03-23 11:05:15.878719 | 2021-03-23 15:38:51.889419 | | merge_status | 0 | IDLE |
| 2021-03-23 11:05:15.878530 | 2021-03-23 11:05:15.878530 | | privilege_version | 0 | |
| 2021-03-23 11:05:15.878858 | 2021-03-23 11:05:15.878858 | | proposal_frozen_version | 1 | |
| 2021-03-23 11:05:15.878903 | 2021-03-23 11:05:15.878903 | | snapshot_gc_ts | 0 | |
| 2021-03-23 11:05:15.878994 | 2021-03-23 11:05:15.878994 | | storage_format_version | 3 | |
| 2021-03-23 11:05:15.878812 | 2021-03-23 11:05:15.878812 | | time_zone_info_version | 0 | |
| 2021-03-23 11:05:15.878236 | 2021-03-23 11:05:15.878236 | | try_frozen_version | 1 | |
| 2021-03-23 11:05:15.878767 | 2021-03-23 11:05:15.878767 | | warm_up_start_time | 0 | |
| 2021-03-23 11:05:15.879309 | 2021-03-23 15:38:41.681707 | zone1 | all_merged_version | 2 | |
| 2021-03-23 11:05:15.879151 | 2021-03-23 15:37:31.857543 | zone1 | broadcast_version | 2 | |
| 2021-03-23 11:05:15.879604 | 2021-03-23 11:05:15.879604 | zone1 | idc | 0 | |
| 2021-03-23 11:05:15.879408 | 2021-03-23 15:38:41.681549 | zone1 | is_merge_timeout | 0 | |
| 2021-03-23 11:05:15.879101 | 2021-03-23 15:38:41.680917 | zone1 | is_merging | 0 | |
| 2021-03-23 11:05:15.879249 | 2021-03-23 15:38:41.681384 | zone1 | last_merged_time | 1616485121680330 | |
| 2021-03-23 11:05:15.879198 | 2021-03-23 15:38:41.681172 | zone1 | last_merged_version | 2 | |
| 2021-03-23 11:05:15.879361 | 2021-03-23 15:37:31.857698 | zone1 | merge_start_time | 1616485051856982 | |
| 2021-03-23 11:05:15.879499 | 2021-03-23 15:38:41.681996 | zone1 | merge_status | 0 | IDLE |
| 2021-03-23 11:05:15.879545 | 2021-03-23 11:05:15.879545 | zone1 | region | 0 | default_region |
| 2021-03-23 11:05:15.879043 | 2021-03-23 11:05:15.879043 | zone1 | status | 2 | ACTIVE |
| 2021-03-23 11:05:15.879453 | 2021-03-23 11:05:15.879453 | zone1 | suspend_merging | 0 | |
| 2021-03-23 11:05:15.879651 | 2021-03-23 11:05:15.879651 | zone1 | zone_type | 0 | ReadWrite |
| 2021-03-23 11:05:15.879929 | 2021-03-23 15:38:24.869439 | zone2 | all_merged_version | 2 | |
| 2021-03-23 11:05:15.879792 | 2021-03-23 15:37:31.862186 | zone2 | broadcast_version | 2 | |
| 2021-03-23 11:05:15.880216 | 2021-03-23 11:05:15.880216 | zone2 | idc | 0 | |
| 2021-03-23 11:05:15.880020 | 2021-03-23 15:38:24.869305 | zone2 | is_merge_timeout | 0 | |
| 2021-03-23 11:05:15.879744 | 2021-03-23 15:38:24.868828 | zone2 | is_merging | 0 | |
| 2021-03-23 11:05:15.879884 | 2021-03-23 15:38:24.869175 | zone2 | last_merged_time | 1616485104868423 | |
| 2021-03-23 11:05:15.879839 | 2021-03-23 15:38:24.869034 | zone2 | last_merged_version | 2 | |
| 2021-03-23 11:05:15.879974 | 2021-03-23 15:37:31.862322 | zone2 | merge_start_time | 1616485051861712 | |
| 2021-03-23 11:05:15.880124 | 2021-03-23 15:38:24.869676 | zone2 | merge_status | 0 | IDLE |
| 2021-03-23 11:05:15.880171 | 2021-03-23 11:05:15.880171 | zone2 | region | 0 | default_region |
| 2021-03-23 11:05:15.879698 | 2021-03-23 11:05:15.879698 | zone2 | status | 2 | ACTIVE |
| 2021-03-23 11:05:15.880064 | 2021-03-23 11:05:15.880064 | zone2 | suspend_merging | 0 | |
| 2021-03-23 11:05:15.880261 | 2021-03-23 11:05:15.880261 | zone2 | zone_type | 0 | ReadWrite |
| 2021-03-23 11:05:15.880563 | 2021-03-23 15:38:31.288313 | zone3 | all_merged_version | 2 | |
| 2021-03-23 11:05:15.880427 | 2021-03-23 15:37:31.865814 | zone3 | broadcast_version | 2 | |
| 2021-03-23 11:05:15.880837 | 2021-03-23 11:05:15.880837 | zone3 | idc | 0 | |
| 2021-03-23 11:05:15.880653 | 2021-03-23 15:38:31.288182 | zone3 | is_merge_timeout | 0 | |
| 2021-03-23 11:05:15.880381 | 2021-03-23 15:38:31.287713 | zone3 | is_merging | 0 | |
| 2021-03-23 11:05:15.880518 | 2021-03-23 15:38:31.288071 | zone3 | last_merged_time | 1616485111287321 | |
| 2021-03-23 11:05:15.880473 | 2021-03-23 15:38:31.287932 | zone3 | last_merged_version | 2 | |
| 2021-03-23 11:05:15.880608 | 2021-03-23 15:37:31.865929 | zone3 | merge_start_time | 1616485051865306 | |
| 2021-03-23 11:05:15.880743 | 2021-03-23 15:38:31.288524 | zone3 | merge_status | 0 | IDLE |
| 2021-03-23 11:05:15.880788 | 2021-03-23 11:05:15.880788 | zone3 | region | 0 | default_region |
| 2021-03-23 11:05:15.880329 | 2021-03-23 11:05:15.880329 | zone3 | status | 2 | ACTIVE |
| 2021-03-23 11:05:15.880698 | 2021-03-23 11:05:15.880698 | zone3 | suspend_merging | 0 | |
| 2021-03-23 11:05:15.880883 | 2021-03-23 11:05:15.880883 | zone3 | zone_type | 0 | ReadWrite |
+----------------------------+----------------------------+-------+--------------------------+------------------+----------------+
56 rows in set (0.00 sec)
obclient>
obclient> alter system add zone 'zone4';
Query OK, 0 rows affected (0.01 sec)
obclient> alter system add zone 'zone5';
Query OK, 0 rows affected (0.01 sec)
obclient> alter system start zone 'zone4';
Query OK, 0 rows affected (0.00 sec)
obclient> alter system start zone 'zone5';
Query OK, 0 rows affected (0.02 sec)
obclient> select * from __all_zone;
+----------------------------+----------------------------+-------+--------------------------+------------------+----------------+
| gmt_create | gmt_modified | zone | name | value | info |
+----------------------------+----------------------------+-------+--------------------------+------------------+----------------+
| 2021-03-23 11:05:15.877798 | 2021-03-23 11:05:15.877798 | | cluster | 0 | obdemo |
| 2021-03-23 11:05:15.878575 | 2021-03-23 15:53:10.982389 | | config_version | 1616485990956854 | |
| 2021-03-23 11:05:15.878387 | 2021-03-23 15:37:12.112042 | | frozen_time | 1616485041674255 | |
| 2021-03-23 11:05:15.878316 | 2021-03-23 15:37:12.111787 | | frozen_version | 2 | |
| 2021-03-23 11:05:15.878948 | 2021-03-23 11:05:15.878948 | | gc_schema_version | 0 | |
| 2021-03-23 11:05:15.878437 | 2021-03-23 15:37:31.695947 | | global_broadcast_version | 2 | |
| 2021-03-23 11:05:15.878669 | 2021-03-23 11:05:15.878669 | | is_merge_error | 0 | |
| 2021-03-23 11:05:15.878484 | 2021-03-23 15:38:51.888516 | | last_merged_version | 2 | |
| 2021-03-23 11:05:15.878621 | 2021-03-23 15:53:10.982593 | | lease_info_version | 1616485990982059 | |
| 2021-03-23 11:05:15.878719 | 2021-03-23 15:38:51.889419 | | merge_status | 0 | IDLE |
| 2021-03-23 11:05:15.878530 | 2021-03-23 11:05:15.878530 | | privilege_version | 0 | |
| 2021-03-23 11:05:15.878858 | 2021-03-23 11:05:15.878858 | | proposal_frozen_version | 1 | |
| 2021-03-23 11:05:15.878903 | 2021-03-23 11:05:15.878903 | | snapshot_gc_ts | 0 | |
| 2021-03-23 11:05:15.878994 | 2021-03-23 11:05:15.878994 | | storage_format_version | 3 | |
| 2021-03-23 11:05:15.878812 | 2021-03-23 11:05:15.878812 | | time_zone_info_version | 0 | |
| 2021-03-23 11:05:15.878236 | 2021-03-23 11:05:15.878236 | | try_frozen_version | 1 | |
| 2021-03-23 11:05:15.878767 | 2021-03-23 11:05:15.878767 | | warm_up_start_time | 0 | |
| 2021-03-23 11:05:15.879309 | 2021-03-23 15:38:41.681707 | zone1 | all_merged_version | 2 | |
| 2021-03-23 11:05:15.879151 | 2021-03-23 15:37:31.857543 | zone1 | broadcast_version | 2 | |
| 2021-03-23 11:05:15.879604 | 2021-03-23 11:05:15.879604 | zone1 | idc | 0 | |
| 2021-03-23 11:05:15.879408 | 2021-03-23 15:38:41.681549 | zone1 | is_merge_timeout | 0 | |
| 2021-03-23 11:05:15.879101 | 2021-03-23 15:38:41.680917 | zone1 | is_merging | 0 | |
| 2021-03-23 11:05:15.879249 | 2021-03-23 15:38:41.681384 | zone1 | last_merged_time | 1616485121680330 | |
| 2021-03-23 11:05:15.879198 | 2021-03-23 15:38:41.681172 | zone1 | last_merged_version | 2 | |
| 2021-03-23 11:05:15.879361 | 2021-03-23 15:37:31.857698 | zone1 | merge_start_time | 1616485051856982 | |
| 2021-03-23 11:05:15.879499 | 2021-03-23 15:38:41.681996 | zone1 | merge_status | 0 | IDLE |
| 2021-03-23 11:05:15.879545 | 2021-03-23 11:05:15.879545 | zone1 | region | 0 | default_region |
| 2021-03-23 11:05:15.879043 | 2021-03-23 11:05:15.879043 | zone1 | status | 2 | ACTIVE |
| 2021-03-23 11:05:15.879453 | 2021-03-23 11:05:15.879453 | zone1 | suspend_merging | 0 | |
| 2021-03-23 11:05:15.879651 | 2021-03-23 11:05:15.879651 | zone1 | zone_type | 0 | ReadWrite |
| 2021-03-23 11:05:15.879929 | 2021-03-23 15:38:24.869439 | zone2 | all_merged_version | 2 | |
| 2021-03-23 11:05:15.879792 | 2021-03-23 15:37:31.862186 | zone2 | broadcast_version | 2 | |
| 2021-03-23 11:05:15.880216 | 2021-03-23 11:05:15.880216 | zone2 | idc | 0 | |
| 2021-03-23 11:05:15.880020 | 2021-03-23 15:38:24.869305 | zone2 | is_merge_timeout | 0 | |
| 2021-03-23 11:05:15.879744 | 2021-03-23 15:38:24.868828 | zone2 | is_merging | 0 | |
| 2021-03-23 11:05:15.879884 | 2021-03-23 15:38:24.869175 | zone2 | last_merged_time | 1616485104868423 | |
| 2021-03-23 11:05:15.879839 | 2021-03-23 15:38:24.869034 | zone2 | last_merged_version | 2 | |
| 2021-03-23 11:05:15.879974 | 2021-03-23 15:37:31.862322 | zone2 | merge_start_time | 1616485051861712 | |
| 2021-03-23 11:05:15.880124 | 2021-03-23 15:38:24.869676 | zone2 | merge_status | 0 | IDLE |
| 2021-03-23 11:05:15.880171 | 2021-03-23 11:05:15.880171 | zone2 | region | 0 | default_region |
| 2021-03-23 11:05:15.879698 | 2021-03-23 11:05:15.879698 | zone2 | status | 2 | ACTIVE |
| 2021-03-23 11:05:15.880064 | 2021-03-23 11:05:15.880064 | zone2 | suspend_merging | 0 | |
| 2021-03-23 11:05:15.880261 | 2021-03-23 11:05:15.880261 | zone2 | zone_type | 0 | ReadWrite |
| 2021-03-23 11:05:15.880563 | 2021-03-23 15:38:31.288313 | zone3 | all_merged_version | 2 | |
| 2021-03-23 11:05:15.880427 | 2021-03-23 15:37:31.865814 | zone3 | broadcast_version | 2 | |
| 2021-03-23 11:05:15.880837 | 2021-03-23 11:05:15.880837 | zone3 | idc | 0 | |
| 2021-03-23 11:05:15.880653 | 2021-03-23 15:38:31.288182 | zone3 | is_merge_timeout | 0 | |
| 2021-03-23 11:05:15.880381 | 2021-03-23 15:38:31.287713 | zone3 | is_merging | 0 | |
| 2021-03-23 11:05:15.880518 | 2021-03-23 15:38:31.288071 | zone3 | last_merged_time | 1616485111287321 | |
| 2021-03-23 11:05:15.880473 | 2021-03-23 15:38:31.287932 | zone3 | last_merged_version | 2 | |
| 2021-03-23 11:05:15.880608 | 2021-03-23 15:37:31.865929 | zone3 | merge_start_time | 1616485051865306 | |
| 2021-03-23 11:05:15.880743 | 2021-03-23 15:38:31.288524 | zone3 | merge_status | 0 | IDLE |
| 2021-03-23 11:05:15.880788 | 2021-03-23 11:05:15.880788 | zone3 | region | 0 | default_region |
| 2021-03-23 11:05:15.880329 | 2021-03-23 11:05:15.880329 | zone3 | status | 2 | ACTIVE |
| 2021-03-23 11:05:15.880698 | 2021-03-23 11:05:15.880698 | zone3 | suspend_merging | 0 | |
| 2021-03-23 11:05:15.880883 | 2021-03-23 11:05:15.880883 | zone3 | zone_type | 0 | ReadWrite |
| 2021-03-23 15:56:58.720194 | 2021-03-23 15:56:58.720194 | zone4 | all_merged_version | 2 | |
| 2021-03-23 15:56:58.719993 | 2021-03-23 15:56:58.719993 | zone4 | broadcast_version | 2 | |
| 2021-03-23 15:56:58.720629 | 2021-03-23 15:56:58.720629 | zone4 | idc | 0 | |
| 2021-03-23 15:56:58.720345 | 2021-03-23 15:56:58.720345 | zone4 | is_merge_timeout | 0 | |
| 2021-03-23 15:56:58.719893 | 2021-03-23 15:56:58.719893 | zone4 | is_merging | 0 | |
| 2021-03-23 15:56:58.720132 | 2021-03-23 15:56:58.720132 | zone4 | last_merged_time | 1616486218718664 | |
| 2021-03-23 15:56:58.720066 | 2021-03-23 15:56:58.720066 | zone4 | last_merged_version | 2 | |
| 2021-03-23 15:56:58.720253 | 2021-03-23 15:56:58.720253 | zone4 | merge_start_time | 1616486218718663 | |
| 2021-03-23 15:56:58.720499 | 2021-03-23 15:56:58.720499 | zone4 | merge_status | 0 | IDLE |
| 2021-03-23 15:56:58.720561 | 2021-03-23 15:56:58.720561 | zone4 | region | 0 | default_region |
| 2021-03-23 15:56:58.719309 | 2021-03-23 15:57:16.750281 | zone4 | status | 2 | ACTIVE |
| 2021-03-23 15:56:58.720431 | 2021-03-23 15:56:58.720431 | zone4 | suspend_merging | 0 | |
| 2021-03-23 15:56:58.720687 | 2021-03-23 15:56:58.720687 | zone4 | zone_type | 0 | ReadWrite |
| 2021-03-23 15:57:06.531977 | 2021-03-23 15:57:06.531977 | zone5 | all_merged_version | 2 | |
| 2021-03-23 15:57:06.531677 | 2021-03-23 15:57:06.531677 | zone5 | broadcast_version | 2 | |
| 2021-03-23 15:57:06.532381 | 2021-03-23 15:57:06.532381 | zone5 | idc | 0 | |
| 2021-03-23 15:57:06.532112 | 2021-03-23 15:57:06.532112 | zone5 | is_merge_timeout | 0 | |
| 2021-03-23 15:57:06.531548 | 2021-03-23 15:57:06.531548 | zone5 | is_merging | 0 | |
| 2021-03-23 15:57:06.531882 | 2021-03-23 15:57:06.531882 | zone5 | last_merged_time | 1616486226530859 | |
| 2021-03-23 15:57:06.531768 | 2021-03-23 15:57:06.531768 | zone5 | last_merged_version | 2 | |
| 2021-03-23 15:57:06.532047 | 2021-03-23 15:57:06.532047 | zone5 | merge_start_time | 1616486226530859 | |
| 2021-03-23 15:57:06.532232 | 2021-03-23 15:57:06.532232 | zone5 | merge_status | 0 | IDLE |
| 2021-03-23 15:57:06.532308 | 2021-03-23 15:57:06.532308 | zone5 | region | 0 | default_region |
| 2021-03-23 15:57:06.531285 | 2021-03-23 15:57:21.354957 | zone5 | status | 2 | ACTIVE |
| 2021-03-23 15:57:06.532173 | 2021-03-23 15:57:06.532173 | zone5 | suspend_merging | 0 | |
| 2021-03-23 15:57:06.532445 | 2021-03-23 15:57:06.532445 | zone5 | zone_type | 0 | ReadWrite |
+----------------------------+----------------------------+-------+--------------------------+------------------+----------------+
82 rows in set (0.00 sec)
obclient>
(2).新的机器上启动observer 进程,分别指定 ZONE 为: zone4 , zone5 。
# su - admin
$ cd /home/admin/oceanbase
bin/observer -i eth0 -P 2882 -p 2881 -z zone4 -d /home/admin/oceanbase/store/obdemo -r '192.168.0.175:2882:2881;192.168.0.119:2882:2881;192.168.0.221:2882:2881' -c 20210323 -n obdemo -o "syslog_level=WARN,memory_limit=8G,cpu_count=16,system_memory=5G,datafile_size=40G,__min_full_resource_pool_memory=536870912,cache_wash_threshold=1G,row_purge_thread_count=1,net_thread_count=1,enable_syslog_recycle=True,enable_merge_by_turn=FALSE,location_refresh_thread_count=2,max_syslog_file_count=3,major_freeze_duty_time=Disable,__easy_memory_limit=1G,schema_history_expire_time=1d,merge_thread_count=1,writing_throttling_trigger_percentage=70,_max_trx_size=2M,workers_per_cpu_quota=2,enable_separate_sys_clog=0,memory_chunk_cache_size=128M,trace_log_slow_query_watermark=10s,writing_throttling_maximum_duration=1m,switchover_process_thread_count=1,minor_freeze_times=500,stack_size=1536K,disk_io_thread_coun=1,config_additional_dir=/data/1/obdemo/etc3;/data/log1/obdemo/etc2"
bin/observer -i eth0 -P 2882 -p 2881 -z zone5 -d /home/admin/oceanbase/store/obdemo -r '192.168.0.175:2882:2881;192.168.0.119:2882:2881;192.168.0.221:2882:2881' -c 20210323 -n obdemo -o "syslog_level=WARN,memory_limit=8G,cpu_count=16,system_memory=5G,datafile_size=40G,__min_full_resource_pool_memory=536870912,cache_wash_threshold=1G,row_purge_thread_count=1,net_thread_count=1,enable_syslog_recycle=True,enable_merge_by_turn=FALSE,location_refresh_thread_count=2,max_syslog_file_count=3,major_freeze_duty_time=Disable,__easy_memory_limit=1G,schema_history_expire_time=1d,merge_thread_count=1,writing_throttling_trigger_percentage=70,_max_trx_size=2M,workers_per_cpu_quota=2,enable_separate_sys_clog=0,memory_chunk_cache_size=128M,trace_log_slow_query_watermark=10s,writing_throttling_maximum_duration=1m,switchover_process_thread_count=1,minor_freeze_times=500,stack_size=1536K,disk_io_thread_coun=1,config_additional_dir=/data/1/obdemo/etc3;/data/log1/obdemo/etc2"
ps -ef|grep observer
netstat -ntlp |grep observer
df -h |egrep home\|data
(3).OB 集群给 zone4 zone5 分别增加对应的机器,命令 add server 。
alter system add server '192.168.0.30:2882' zone 'zone4';
alter system add server '192.168.0.58:2882' zone 'zone5';
示例如下:
obclient> source servers.sql
+-------+---------------+----------+------------+-----------------+--------+----------------------------+----------------------------+---------------+
| zone | svr_ip | svr_port | inner_port | with_rootserver | status | gmt_create | start_service_time | build_version |
+-------+---------------+----------+------------+-----------------+--------+----------------------------+----------------------------+---------------+
| zone1 | 192.168.0.175 | 2882 | 2881 | 1 | active | 2021-03-23 11:05:05.341939 | 2021-03-23 15:52:44.897894 | 2.2.50_1 |
| zone2 | 192.168.0.119 | 2882 | 2881 | 0 | active | 2021-03-23 11:05:04.434825 | 2021-03-23 15:52:46.224564 | 2.2.50_1 |
| zone3 | 192.168.0.221 | 2882 | 2881 | 0 | active | 2021-03-23 11:05:04.586951 | 2021-03-23 15:52:46.967032 | 2.2.50_1 |
+-------+---------------+----------+------------+-----------------+--------+----------------------------+----------------------------+---------------+
3 rows in set (0.01 sec)
obclient> alter system add server '192.168.0.30:2882' zone 'zone4';
Query OK, 0 rows affected (0.05 sec)
obclient> alter system add server '192.168.0.58:2882' zone 'zone5';
Query OK, 0 rows affected (0.03 sec)
obclient> source servers.sql
+-------+---------------+----------+------------+-----------------+--------+----------------------------+----------------------------+---------------+
| zone | svr_ip | svr_port | inner_port | with_rootserver | status | gmt_create | start_service_time | build_version |
+-------+---------------+----------+------------+-----------------+--------+----------------------------+----------------------------+---------------+
| zone1 | 192.168.0.175 | 2882 | 2881 | 1 | active | 2021-03-23 11:05:05.341939 | 2021-03-23 15:52:44.897894 | 2.2.50_1 |
| zone2 | 192.168.0.119 | 2882 | 2881 | 0 | active | 2021-03-23 11:05:04.434825 | 2021-03-23 15:52:46.224564 | 2.2.50_1 |
| zone3 | 192.168.0.221 | 2882 | 2881 | 0 | active | 2021-03-23 11:05:04.586951 | 2021-03-23 15:52:46.967032 | 2.2.50_1 |
| zone4 | 192.168.0.30 | 2882 | 2881 | 0 | active | 2021-03-23 16:02:41.300011 | 2021-03-23 16:02:49.621012 | 2.2.50_1 |
| zone5 | 192.168.0.58 | 2882 | 2881 | 0 | active | 2021-03-23 16:02:47.892878 | 2021-03-23 16:03:00.398104 | 2.2.50_1 |
+-------+---------------+----------+------------+-----------------+--------+----------------------------+----------------------------+---------------+
5 rows in set (0.01 sec)
obclient>
此时集群变为 5 副本,但是集群内部的租户依然是 3 副本架构。
obclient> source tent.sql
+-----------+-----------------+--------------------+-------------------+---------------------------------------------+-------------------+----------------------------+
| tenant_id | tenant_name | compatibility_mode | zone_list | locality | primary_zone | gmt_modified |
+-----------+-----------------+--------------------+-------------------+---------------------------------------------+-------------------+----------------------------+
| 1 | sys | 0 | zone1;zone2;zone3 | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3 | zone1;zone2,zone3 | 2021-03-23 12:11:27.814891 |
| 1001 | mysql_test_tent | 0 | zone1;zone2;zone3 | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3 | RANDOM | 2021-03-23 12:14:12.333276 |
| 1002 | ora_test_tent | 1 | zone1;zone2;zone3 | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3 | RANDOM | 2021-03-23 12:00:18.492501 |
+-----------+-----------------+--------------------+-------------------+---------------------------------------------+-------------------+----------------------------+
3 rows in set (0.01 sec)
obclient>
(4). 为每个租户在新zone上分别准备对应的资源池,包括业务租户和sys租户。命令:create resource pool 。
注意:这里不能对新增加的zone直接修改资源池的zone_list,因为新zone不支持,否则会报如下错误:
obclient> alter resource pool mysql_test_pool zone_list = ('zone1','zone2','zone3','zone4','zone5');
ERROR 1235 (0A000): alter resurce pool zone list with a new zone not supported
obclient>
只能创建新的资源池,指定规格和原来的规格一致,新资源池zone_list为新的zone,并修改租户的resource_pool_list,命令如下:
create resource pool new_mysql_test_pool unit = 'my_unit_1c1g', unit_num = 1, zone_list=('zone4','zone5');
create resource pool new_ora_test_pool unit = 'my_unit_1c1g', unit_num = 1, zone_list=('zone4','zone5');
create resource pool new_sys_pool unit = 'sys_unit_config', unit_num = 1, zone_list=('zone4','zone5');
alter tenant mysql_test_tent resource_pool_list=('mysql_test_pool','new_mysql_test_pool');
alter tenant ora_test_tent resource_pool_list=('ora_test_pool','new_ora_test_pool');
alter tenant sys resource_pool_list=('sys_pool','new_sys_pool');
示例如下:
obclient> source pool.sql
+--------------------+------------------+---------+---------+------------+------------+---------+-------+--------------------+-----------+-----------------+
| resource_pool_name | unit_config_name | max_cpu | min_cpu | max_mem_gb | min_mem_gb | unit_id | zone | observer | tenant_id | tenant_name |
+--------------------+------------------+---------+---------+------------+------------+---------+-------+--------------------+-----------+-----------------+
| sys_pool | sys_unit_config | 5 | 2.5 | 1 | 1 | 1 | zone1 | 192.168.0.175:2882 | 1 | sys |
| sys_pool | sys_unit_config | 5 | 2.5 | 1 | 1 | 2 | zone2 | 192.168.0.119:2882 | 1 | sys |
| sys_pool | sys_unit_config | 5 | 2.5 | 1 | 1 | 3 | zone3 | 192.168.0.221:2882 | 1 | sys |
| mysql_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1001 | zone1 | 192.168.0.175:2882 | 1001 | mysql_test_tent |
| mysql_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1002 | zone2 | 192.168.0.119:2882 | 1001 | mysql_test_tent |
| mysql_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1003 | zone3 | 192.168.0.221:2882 | 1001 | mysql_test_tent |
| ora_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1006 | zone1 | 192.168.0.175:2882 | 1002 | ora_test_tent |
| ora_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1007 | zone2 | 192.168.0.119:2882 | 1002 | ora_test_tent |
| ora_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1008 | zone3 | 192.168.0.221:2882 | 1002 | ora_test_tent |
+--------------------+------------------+---------+---------+------------+------------+---------+-------+--------------------+-----------+-----------------+
9 rows in set (0.00 sec)
obclient> alter resource pool mysql_test_pool zone_list = ('zone1','zone2','zone3','zone4','zone5');
ERROR 1235 (0A000): alter resurce pool zone list with a new zone not supported
obclient>
obclient> create resource pool new_mysql_test_pool unit = 'my_unit_1c1g', unit_num = 1, zone_list=('zone4','zone5');
Query OK, 0 rows affected (0.05 sec)
obclient> create resource pool new_ora_test_pool unit = 'my_unit_1c1g', unit_num = 1, zone_list=('zone4','zone5');
Query OK, 0 rows affected (0.06 sec)
obclient> create resource pool new_sys_pool unit = 'sys_unit_config', unit_num = 1, zone_list=('zone4','zone5');
Query OK, 0 rows affected (0.01 sec)
obclient>
obclient> source pool.sql
+---------------------+------------------+---------+---------+------------+------------+---------+-------+--------------------+-----------+-----------------+
| resource_pool_name | unit_config_name | max_cpu | min_cpu | max_mem_gb | min_mem_gb | unit_id | zone | observer | tenant_id | tenant_name |
+---------------------+------------------+---------+---------+------------+------------+---------+-------+--------------------+-----------+-----------------+
| sys_pool | sys_unit_config | 5 | 2.5 | 1 | 1 | 1 | zone1 | 192.168.0.175:2882 | 1 | sys |
| sys_pool | sys_unit_config | 5 | 2.5 | 1 | 1 | 2 | zone2 | 192.168.0.119:2882 | 1 | sys |
| sys_pool | sys_unit_config | 5 | 2.5 | 1 | 1 | 3 | zone3 | 192.168.0.221:2882 | 1 | sys |
| mysql_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1001 | zone1 | 192.168.0.175:2882 | 1001 | mysql_test_tent |
| mysql_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1002 | zone2 | 192.168.0.119:2882 | 1001 | mysql_test_tent |
| mysql_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1003 | zone3 | 192.168.0.221:2882 | 1001 | mysql_test_tent |
| ora_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1006 | zone1 | 192.168.0.175:2882 | 1002 | ora_test_tent |
| ora_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1007 | zone2 | 192.168.0.119:2882 | 1002 | ora_test_tent |
| ora_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1008 | zone3 | 192.168.0.221:2882 | 1002 | ora_test_tent |
| new_mysql_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1011 | zone4 | 192.168.0.30:2882 | NULL | NULL |
| new_mysql_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1012 | zone5 | 192.168.0.58:2882 | NULL | NULL |
| new_ora_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1013 | zone4 | 192.168.0.30:2882 | NULL | NULL |
| new_ora_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1014 | zone5 | 192.168.0.58:2882 | NULL | NULL |
| new_sys_pool | sys_unit_config | 5 | 2.5 | 1 | 1 | 1015 | zone4 | 192.168.0.30:2882 | NULL | NULL |
| new_sys_pool | sys_unit_config | 5 | 2.5 | 1 | 1 | 1016 | zone5 | 192.168.0.58:2882 | NULL | NULL |
+---------------------+------------------+---------+---------+------------+------------+---------+-------+--------------------+-----------+-----------------+
15 rows in set (0.00 sec)
obclient>
obclient> alter tenant mysql_test_tent resource_pool_list=('mysql_test_pool','new_mysql_test_pool');
Query OK, 0 rows affected (0.09 sec)
obclient>
obclient> alter tenant ora_test_tent resource_pool_list=('ora_test_pool','new_ora_test_pool');
Query OK, 0 rows affected (0.09 sec)
obclient>
obclient> alter tenant sys resource_pool_list=('sys_pool','new_sys_pool');
Query OK, 0 rows affected (0.11 sec)
obclient>
obclient> source pool.sql
+---------------------+------------------+---------+---------+------------+------------+---------+-------+--------------------+-----------+-----------------+
| resource_pool_name | unit_config_name | max_cpu | min_cpu | max_mem_gb | min_mem_gb | unit_id | zone | observer | tenant_id | tenant_name |
+---------------------+------------------+---------+---------+------------+------------+---------+-------+--------------------+-----------+-----------------+
| sys_pool | sys_unit_config | 5 | 2.5 | 1 | 1 | 1 | zone1 | 192.168.0.175:2882 | 1 | sys |
| sys_pool | sys_unit_config | 5 | 2.5 | 1 | 1 | 2 | zone2 | 192.168.0.119:2882 | 1 | sys |
| sys_pool | sys_unit_config | 5 | 2.5 | 1 | 1 | 3 | zone3 | 192.168.0.221:2882 | 1 | sys |
| mysql_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1001 | zone1 | 192.168.0.175:2882 | 1001 | mysql_test_tent |
| mysql_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1002 | zone2 | 192.168.0.119:2882 | 1001 | mysql_test_tent |
| mysql_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1003 | zone3 | 192.168.0.221:2882 | 1001 | mysql_test_tent |
| ora_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1006 | zone1 | 192.168.0.175:2882 | 1002 | ora_test_tent |
| ora_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1007 | zone2 | 192.168.0.119:2882 | 1002 | ora_test_tent |
| ora_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1008 | zone3 | 192.168.0.221:2882 | 1002 | ora_test_tent |
| new_mysql_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1011 | zone4 | 192.168.0.30:2882 | 1001 | mysql_test_tent |
| new_mysql_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1012 | zone5 | 192.168.0.58:2882 | 1001 | mysql_test_tent |
| new_ora_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1013 | zone4 | 192.168.0.30:2882 | 1002 | ora_test_tent |
| new_ora_test_pool | my_unit_1c1g | 1 | 1 | 1 | 1 | 1014 | zone5 | 192.168.0.58:2882 | 1002 | ora_test_tent |
| new_sys_pool | sys_unit_config | 5 | 2.5 | 1 | 1 | 1015 | zone4 | 192.168.0.30:2882 | 1 | sys |
| new_sys_pool | sys_unit_config | 5 | 2.5 | 1 | 1 | 1016 | zone5 | 192.168.0.58:2882 | 1 | sys |
+---------------------+------------------+---------+---------+------------+------------+---------+-------+--------------------+-----------+-----------------+
15 rows in set (0.00 sec)
obclient>
此时集群内部的租户依然是 3 副本架构。
obclient> source tent.sql
+-----------+-----------------+--------------------+-------------------+---------------------------------------------+-------------------+----------------------------+
| tenant_id | tenant_name | compatibility_mode | zone_list | locality | primary_zone | gmt_modified |
+-----------+-----------------+--------------------+-------------------+---------------------------------------------+-------------------+----------------------------+
| 1 | sys | 0 | zone1;zone2;zone3 | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3 | zone1;zone2,zone3 | 2021-03-23 16:28:46.632710 |
| 1001 | mysql_test_tent | 0 | zone1;zone2;zone3 | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3 | RANDOM | 2021-03-23 16:27:55.582885 |
| 1002 | ora_test_tent | 1 | zone1;zone2;zone3 | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3 | RANDOM | 2021-03-23 16:28:43.465091 |
+-----------+-----------------+--------------------+-------------------+---------------------------------------------+-------------------+----------------------------+
3 rows in set (0.01 sec)
obclient>
(5).调整每个租户副本数,修改租户的 locality。此时 OB 内部自动在目标 zone4 和 zone5 添加新的副本。
alter tenant mysql_test_tent locality='FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3, FULL{1}@zone4, FULL{1}@zone5';
alter tenant ora_test_tent locality='FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3, FULL{1}@zone4, FULL{1}@zone5';
alter tenant sys locality='FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3, FULL{1}@zone4, FULL{1}@zone5';
示例如下:
obclient> source tent.sql
+-----------+-----------------+--------------------+-------------------+---------------------------------------------+-------------------+----------------------------+
| tenant_id | tenant_name | compatibility_mode | zone_list | locality | primary_zone | gmt_modified |
+-----------+-----------------+--------------------+-------------------+---------------------------------------------+-------------------+----------------------------+
| 1 | sys | 0 | zone1;zone2;zone3 | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3 | zone1;zone2,zone3 | 2021-03-23 16:28:46.632710 |
| 1001 | mysql_test_tent | 0 | zone1;zone2;zone3 | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3 | RANDOM | 2021-03-23 16:27:55.582885 |
| 1002 | ora_test_tent | 1 | zone1;zone2;zone3 | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3 | RANDOM | 2021-03-23 16:28:43.465091 |
+-----------+-----------------+--------------------+-------------------+---------------------------------------------+-------------------+----------------------------+
3 rows in set (0.00 sec)
obclient>
obclient> alter tenant mysql_test_tent locality='FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3, FULL{1}@zone4, FULL{1}@zone5';
Query OK, 0 rows affected (0.11 sec)
obclient> alter tenant ora_test_tent locality='FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3, FULL{1}@zone4, FULL{1}@zone5';
Query OK, 0 rows affected (0.58 sec)
obclient> alter tenant sys locality='FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3, FULL{1}@zone4, FULL{1}@zone5';
Query OK, 0 rows affected (0.18 sec)
obclient> source tent.sql
+-----------+-----------------+--------------------+-------------------------------+---------------------------------------------------------------------------+-------------------------------+----------------------------+
| tenant_id | tenant_name | compatibility_mode | zone_list | locality | primary_zone | gmt_modified |
+-----------+-----------------+--------------------+-------------------------------+---------------------------------------------------------------------------+-------------------------------+----------------------------+
| 1 | sys | 0 | zone1;zone2;zone3;zone4;zone5 | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3, FULL{1}@zone4, FULL{1}@zone5 | zone1;zone2,zone3;zone4,zone5 | 2021-03-23 16:40:03.666611 |
| 1001 | mysql_test_tent | 0 | zone1;zone2;zone3;zone4;zone5 | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3, FULL{1}@zone4, FULL{1}@zone5 | RANDOM | 2021-03-23 16:39:36.873087 |
| 1002 | ora_test_tent | 1 | zone1;zone2;zone3;zone4;zone5 | FULL{1}@zone1, FULL{1}@zone2, FULL{1}@zone3, FULL{1}@zone4, FULL{1}@zone5 | RANDOM | 2021-03-23 16:39:59.717504 |
+-----------+-----------------+--------------------+-------------------------------+---------------------------------------------------------------------------+-------------------------------+----------------------------+
3 rows in set (0.00 sec)
obclient>
此时虽然租户是5副本架构了,但租户内部的复制表test_full依然是3副本:
obclient> source part.sql
+-----------+-----------------+---------------+------------------+------------+---------------+----------+--------------+-------+---------------+----------+------+--------------+
| tenant_id | tenant_name | database_name | table_id | table_Name | tablegroup_id | part_num | partition_Id | zone | svr_ip | svr_port | role | data_size_mb |
+-----------+-----------------+---------------+------------------+------------+---------------+----------+--------------+-------+---------------+----------+------+--------------+
| 1001 | mysql_test_tent | testdb | 1100611139453777 | test | -1 | 1 | 0 | zone1 | 192.168.0.175 | 2882 | 1 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453777 | test | -1 | 1 | 0 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453777 | test | -1 | 1 | 0 | zone5 | 192.168.0.58 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453777 | test | -1 | 1 | 0 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453777 | test | -1 | 1 | 0 | zone4 | 192.168.0.30 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453779 | test_full | -1 | 1 | 0 | zone1 | 192.168.0.175 | 2882 | 1 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453779 | test_full | -1 | 1 | 0 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453779 | test_full | -1 | 1 | 0 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 0 | zone2 | 192.168.0.119 | 2882 | 1 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 0 | zone5 | 192.168.0.58 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 0 | zone4 | 192.168.0.30 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 0 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 0 | zone1 | 192.168.0.175 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 1 | zone3 | 192.168.0.221 | 2882 | 1 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 1 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 1 | zone1 | 192.168.0.175 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 1 | zone4 | 192.168.0.30 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 1 | zone5 | 192.168.0.58 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 2 | zone4 | 192.168.0.30 | 2882 | 1 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 2 | zone5 | 192.168.0.58 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 2 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 2 | zone1 | 192.168.0.175 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 2 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 3 | zone5 | 192.168.0.58 | 2882 | 1 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 3 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 3 | zone4 | 192.168.0.30 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 3 | zone1 | 192.168.0.175 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 3 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 4 | zone1 | 192.168.0.175 | 2882 | 1 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 4 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 4 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 4 | zone4 | 192.168.0.30 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 4 | zone5 | 192.168.0.58 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081553 | TEST | -1 | 1 | 0 | zone2 | 192.168.0.119 | 2882 | 1 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081553 | TEST | -1 | 1 | 0 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081553 | TEST | -1 | 1 | 0 | zone4 | 192.168.0.30 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081553 | TEST | -1 | 1 | 0 | zone5 | 192.168.0.58 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081553 | TEST | -1 | 1 | 0 | zone1 | 192.168.0.175 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081555 | TEST_FULL | -1 | 1 | 0 | zone1 | 192.168.0.175 | 2882 | 1 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081555 | TEST_FULL | -1 | 1 | 0 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081555 | TEST_FULL | -1 | 1 | 0 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 0 | zone3 | 192.168.0.221 | 2882 | 1 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 0 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 0 | zone1 | 192.168.0.175 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 0 | zone4 | 192.168.0.30 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 0 | zone5 | 192.168.0.58 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 1 | zone4 | 192.168.0.30 | 2882 | 1 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 1 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 1 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 1 | zone5 | 192.168.0.58 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 1 | zone1 | 192.168.0.175 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 2 | zone5 | 192.168.0.58 | 2882 | 1 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 2 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 2 | zone1 | 192.168.0.175 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 2 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 2 | zone4 | 192.168.0.30 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 3 | zone1 | 192.168.0.175 | 2882 | 1 | 0 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 3 | zone2 | 192.168.0.119 | 2882 | 2 | 0 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 3 | zone5 | 192.168.0.58 | 2882 | 2 | 0 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 3 | zone4 | 192.168.0.30 | 2882 | 2 | 0 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 3 | zone3 | 192.168.0.221 | 2882 | 2 | 0 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 4 | zone2 | 192.168.0.119 | 2882 | 1 | 0 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 4 | zone1 | 192.168.0.175 | 2882 | 2 | 0 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 4 | zone3 | 192.168.0.221 | 2882 | 2 | 0 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 4 | zone4 | 192.168.0.30 | 2882 | 2 | 0 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 4 | zone5 | 192.168.0.58 | 2882 | 2 | 0 |
+-----------+-----------------+---------------+------------------+------------+---------------+----------+--------------+-------+---------------+----------+------+--------------+
66 rows in set (1.04 sec)
obclient>
[admin@ob-docker my]$ obclient -h127.1 -uaps2@mysql_test_tent#obdemo -P2883 -paps2#12345 -c -A testdb
obclient: [Warning] Using a password on the command line interface can be insecure.
Welcome to the OceanBase monitor. Commands end with ; or \g.
Your OceanBase connection id is 185
Server version: 5.6.25 OceanBase 2.2.50 (r1-1c6441e8fb858c80da395f934f67ed305425864e) (Built Mar 6 2020 18:41:01)
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
obclient> show create table test_full\G
*************************** 1. row ***************************
Table: test_full
Create Table: CREATE TABLE `test_full` (
`id` int(11) NOT NULL,
`name` varchar(20) NOT NULL,
`age` int(11) DEFAULT NULL,
`dt` datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) DEFAULT CHARSET = utf8mb4 ROW_FORMAT = DYNAMIC COMPRESSION = 'zstd_1.0' REPLICA_NUM = 3 LOCALITY = 'FULL{1},READONLY{ALL_SERVER}@zone1, FULL{1},READONLY{ALL_SERVER}@zone2, FULL{1},READONLY{ALL_SERVER}@zone3' PRIMARY_ZONE = 'zone1;zone2,zone3;zone4,zone5' BLOCK_SIZE = 16384 USE_BLOOM_FILTER = FALSE TABLET_SIZE = 134217728 PCTFREE = 10
1 row in set (0.03 sec)
obclient>
(6).最后调整复制表的副本数,修改租户里的复制表的 locality ,增加 zone4 和 zone5 。
alter table test_full locality='F,R{all_server}@zone1, F,R{all_server}@zone2, F,R{all_server}@zone3, F,R{all_server}@zone4, F,R{all_server}@zone5';
示例如下:
[admin@ob-docker my]$ obclient -h127.1 -uaps2@mysql_test_tent#obdemo -P2883 -paps2#12345 -c -A testdb
obclient: [Warning] Using a password on the command line interface can be insecure.
Welcome to the OceanBase monitor. Commands end with ; or \g.
Your OceanBase connection id is 185
Server version: 5.6.25 OceanBase 2.2.50 (r1-1c6441e8fb858c80da395f934f67ed305425864e) (Built Mar 6 2020 18:41:01)
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
obclient> show create table test_full\G
*************************** 1. row ***************************
Table: test_full
Create Table: CREATE TABLE `test_full` (
`id` int(11) NOT NULL,
`name` varchar(20) NOT NULL,
`age` int(11) DEFAULT NULL,
`dt` datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) DEFAULT CHARSET = utf8mb4 ROW_FORMAT = DYNAMIC COMPRESSION = 'zstd_1.0' REPLICA_NUM = 3 LOCALITY = 'FULL{1},READONLY{ALL_SERVER}@zone1, FULL{1},READONLY{ALL_SERVER}@zone2, FULL{1},READONLY{ALL_SERVER}@zone3' PRIMARY_ZONE = 'zone1;zone2,zone3' BLOCK_SIZE = 16384 USE_BLOOM_FILTER = FALSE TABLET_SIZE = 134217728 PCTFREE = 10
1 row in set (0.03 sec)
obclient> alter table test_full locality='F,R{all_server}@zone1, F,R{all_server}@zone2, F,R{all_server}@zone3, F,R{all_server}@zone4, F,R{all_server}@zone5';
Query OK, 0 rows affected (0.61 sec)
obclient> show create table test_full\G
*************************** 1. row ***************************
Table: test_full
Create Table: CREATE TABLE `test_full` (
`id` int(11) NOT NULL,
`name` varchar(20) NOT NULL,
`age` int(11) DEFAULT NULL,
`dt` datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) DEFAULT CHARSET = utf8mb4 ROW_FORMAT = DYNAMIC COMPRESSION = 'zstd_1.0' REPLICA_NUM = 5 LOCALITY = 'FULL{1},READONLY{ALL_SERVER}@zone1, FULL{1},READONLY{ALL_SERVER}@zone2, FULL{1},READONLY{ALL_SERVER}@zone3, FULL{1},READONLY{ALL_SERVER}@zone4, FULL{1},READONLY{ALL_SERVER}@zone5' PRIMARY_ZONE = 'zone1;zone2,zone3;zone4,zone5' BLOCK_SIZE = 16384 USE_BLOOM_FILTER = FALSE TABLET_SIZE = 134217728 PCTFREE = 10
1 row in set (0.00 sec)
obclient>
obclient> exit
Bye
[admin@ob-docker my]$
[admin@ob-docker my]$ obclient -h127.1 -uaps2@ora_test_tent#obdemo -P2883 -paps2#12345 -c -A aps2
obclient: [Warning] Using a password on the command line interface can be insecure.
Welcome to the OceanBase monitor. Commands end with ; or \g.
Your OceanBase connection id is 186
Server version: 5.6.25 OceanBase 2.2.50 (r1-1c6441e8fb858c80da395f934f67ed305425864e) (Built Mar 6 2020 18:41:01)
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
obclient> show create table test_full\G
*************************** 1. row ***************************
TABLE: TEST_FULL
CREATE TABLE: CREATE TABLE "TEST_FULL" (
"ID" NUMBER(38) NOT NULL,
"NAME" VARCHAR2(20) NOT NULL,
"AGE" NUMBER(38),
"DT" DATE DEFAULT sysdate,
CONSTRAINT "TEST_FULL_OBPK_1616470329519050" PRIMARY KEY ("ID")
) COMPRESS FOR ARCHIVE REPLICA_NUM = 3 LOCALITY = 'FULL{1},READONLY{ALL_SERVER}@zone1, FULL{1},READONLY{ALL_SERVER}@zone2, FULL{1},READONLY{ALL_SERVER}@zone3' PRIMARY_ZONE = 'zone1;zone2,zone3' BLOCK_SIZE = 16384 USE_BLOOM_FILTER = FALSE TABLET_SIZE = 134217728 PCTFREE = 10
1 row in set (0.04 sec)
obclient> alter table test_full locality='F,R{all_server}@zone1, F,R{all_server}@zone2, F,R{all_server}@zone3, F,R{all_server}@zone4, F,R{all_server}@zone5';
Query OK, 0 rows affected (0.36 sec)
obclient> show create table test_full\G
*************************** 1. row ***************************
TABLE: TEST_FULL
CREATE TABLE: CREATE TABLE "TEST_FULL" (
"ID" NUMBER(38) NOT NULL,
"NAME" VARCHAR2(20) NOT NULL,
"AGE" NUMBER(38),
"DT" DATE DEFAULT sysdate,
CONSTRAINT "TEST_FULL_OBPK_1616470329519050" PRIMARY KEY ("ID")
) COMPRESS FOR ARCHIVE REPLICA_NUM = 5 LOCALITY = 'FULL{1},READONLY{ALL_SERVER}@zone1, FULL{1},READONLY{ALL_SERVER}@zone2, FULL{1},READONLY{ALL_SERVER}@zone3, FULL{1},READONLY{ALL_SERVER}@zone4, FULL{1},READONLY{ALL_SERVER}@zone5' PRIMARY_ZONE = 'zone1;zone2,zone3;zone4,zone5' BLOCK_SIZE = 16384 USE_BLOOM_FILTER = FALSE TABLET_SIZE = 134217728 PCTFREE = 10
1 row in set (0.01 sec)
obclient> exit
Bye
[admin@ob-docker my]$
最后分区副本迁移完成后,租户下所有分区副本分布如下:
obclient> source part.sql
+-----------+-----------------+---------------+------------------+------------+---------------+----------+--------------+-------+---------------+----------+------+--------------+
| tenant_id | tenant_name | database_name | table_id | table_Name | tablegroup_id | part_num | partition_Id | zone | svr_ip | svr_port | role | data_size_mb |
+-----------+-----------------+---------------+------------------+------------+---------------+----------+--------------+-------+---------------+----------+------+--------------+
| 1001 | mysql_test_tent | testdb | 1100611139453777 | test | -1 | 1 | 0 | zone1 | 192.168.0.175 | 2882 | 1 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453777 | test | -1 | 1 | 0 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453777 | test | -1 | 1 | 0 | zone5 | 192.168.0.58 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453777 | test | -1 | 1 | 0 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453777 | test | -1 | 1 | 0 | zone4 | 192.168.0.30 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453779 | test_full | -1 | 1 | 0 | zone1 | 192.168.0.175 | 2882 | 1 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453779 | test_full | -1 | 1 | 0 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453779 | test_full | -1 | 1 | 0 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453779 | test_full | -1 | 1 | 0 | zone4 | 192.168.0.30 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453779 | test_full | -1 | 1 | 0 | zone5 | 192.168.0.58 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 0 | zone2 | 192.168.0.119 | 2882 | 1 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 0 | zone5 | 192.168.0.58 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 0 | zone4 | 192.168.0.30 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 0 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 0 | zone1 | 192.168.0.175 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 1 | zone3 | 192.168.0.221 | 2882 | 1 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 1 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 1 | zone1 | 192.168.0.175 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 1 | zone4 | 192.168.0.30 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 1 | zone5 | 192.168.0.58 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 2 | zone4 | 192.168.0.30 | 2882 | 1 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 2 | zone5 | 192.168.0.58 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 2 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 2 | zone1 | 192.168.0.175 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 2 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 3 | zone5 | 192.168.0.58 | 2882 | 1 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 3 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 3 | zone4 | 192.168.0.30 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 3 | zone1 | 192.168.0.175 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 3 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 4 | zone1 | 192.168.0.175 | 2882 | 1 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 4 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 4 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 4 | zone4 | 192.168.0.30 | 2882 | 2 | 2 |
| 1001 | mysql_test_tent | testdb | 1100611139453778 | test_hash | -1 | 5 | 4 | zone5 | 192.168.0.58 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081553 | TEST | -1 | 1 | 0 | zone2 | 192.168.0.119 | 2882 | 1 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081553 | TEST | -1 | 1 | 0 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081553 | TEST | -1 | 1 | 0 | zone4 | 192.168.0.30 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081553 | TEST | -1 | 1 | 0 | zone5 | 192.168.0.58 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081553 | TEST | -1 | 1 | 0 | zone1 | 192.168.0.175 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081555 | TEST_FULL | -1 | 1 | 0 | zone1 | 192.168.0.175 | 2882 | 1 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081555 | TEST_FULL | -1 | 1 | 0 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081555 | TEST_FULL | -1 | 1 | 0 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081555 | TEST_FULL | -1 | 1 | 0 | zone4 | 192.168.0.30 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081555 | TEST_FULL | -1 | 1 | 0 | zone5 | 192.168.0.58 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 0 | zone3 | 192.168.0.221 | 2882 | 1 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 0 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 0 | zone1 | 192.168.0.175 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 0 | zone4 | 192.168.0.30 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 0 | zone5 | 192.168.0.58 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 1 | zone4 | 192.168.0.30 | 2882 | 1 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 1 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 1 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 1 | zone5 | 192.168.0.58 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 1 | zone1 | 192.168.0.175 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 2 | zone5 | 192.168.0.58 | 2882 | 1 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 2 | zone2 | 192.168.0.119 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 2 | zone1 | 192.168.0.175 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 2 | zone3 | 192.168.0.221 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 2 | zone4 | 192.168.0.30 | 2882 | 2 | 2 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 3 | zone1 | 192.168.0.175 | 2882 | 1 | 0 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 3 | zone2 | 192.168.0.119 | 2882 | 2 | 0 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 3 | zone5 | 192.168.0.58 | 2882 | 2 | 0 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 3 | zone4 | 192.168.0.30 | 2882 | 2 | 0 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 3 | zone3 | 192.168.0.221 | 2882 | 2 | 0 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 4 | zone2 | 192.168.0.119 | 2882 | 1 | 0 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 4 | zone1 | 192.168.0.175 | 2882 | 2 | 0 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 4 | zone3 | 192.168.0.221 | 2882 | 2 | 0 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 4 | zone4 | 192.168.0.30 | 2882 | 2 | 0 |
| 1002 | ora_test_tent | APS2 | 1101710651081556 | TEST_HASH | -1 | 5 | 4 | zone5 | 192.168.0.58 | 2882 | 2 | 0 |
+-----------+-----------------+---------------+------------------+------------+---------------+----------+--------------+-------+---------------+----------+------+--------------+
70 rows in set (0.49 sec)
obclient>
到此,ob集群从3副本1-1-1架构升级为5副本1-1-1-1-1架构已完成。
一步一步学习oceanbase系列
复制