某项目共20个节点的GBase 8a 9.5.3版本集群,发生2台服务器硬件故障,其中1台纯数据数据节点,另一台是管理gcware+调度coordinator+数据计算服务gnode的复合节点,本文记录整个操作过程。
目录导航
环境
共20个节点的集群,其中76和86两个节点服务器故障需要维修。 其中86节点是纯计算节点,76节点是管理+调度+计算节点。
[gbase@bd48db02 gcware_server]$ gcadmin
CLUSTER STATE: ACTIVE
VIRTUAL CLUSTER MODE: NORMAL
====================================
| GBASE GCWARE CLUSTER INFORMATION |
====================================
| NodeName | IpAddress | gcware |
------------------------------------
| gcware1 | XX.XX.XX.72 | OPEN |
------------------------------------
| gcware2 | XX.XX.XX.73 | OPEN |
------------------------------------
| gcware3 | XX.XX.XX.74 | OPEN |
------------------------------------
| gcware4 | XX.XX.XX.75 | OPEN |
------------------------------------
| gcware5 | XX.XX.XX.76 | CLOSE |
------------------------------------
| gcware6 | XX.XX.XX.77 | OPEN |
------------------------------------
| gcware7 | XX.XX.XX.78 | OPEN |
------------------------------------
========================================================
| GBASE COORDINATOR CLUSTER INFORMATION |
========================================================
| NodeName | IpAddress | gcluster | DataState |
--------------------------------------------------------
| coordinator1 | XX.XX.XX.72 | OPEN | 0 |
--------------------------------------------------------
| coordinator2 | XX.XX.XX.73 | OPEN | 0 |
--------------------------------------------------------
| coordinator3 | XX.XX.XX.74 | OPEN | 0 |
--------------------------------------------------------
| coordinator4 | XX.XX.XX.75 | OPEN | 0 |
--------------------------------------------------------
| coordinator5 | XX.XX.XX.76 | UNAVAILABLE | |
--------------------------------------------------------
| coordinator6 | XX.XX.XX.77 | OPEN | 0 |
--------------------------------------------------------
| coordinator7 | XX.XX.XX.78 | OPEN | 0 |
--------------------------------------------------------
===============================================================================================================
| GBASE DATA CLUSTER INFORMATION |
===============================================================================================================
| NodeName | IpAddress | DistributionId | gnode | syncserver | DataState |
---------------------------------------------------------------------------------------------------------------
| node1 | XX.XX.XX.82 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node2 | XX.XX.XX.83 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node3 | XX.XX.XX.88 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node4 | XX.XX.XX.81 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node5 | XX.XX.XX.80 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node6 | XX.XX.XX.77 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node7 | XX.XX.XX.76 | 1 | UNAVAILABLE | | |
---------------------------------------------------------------------------------------------------------------
| node8 | XX.XX.XX.79 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node9 | XX.XX.XX.78 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node10 | XX.XX.XX.73 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node11 | XX.XX.XX.72 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node12 | XX.XX.XX.75 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node13 | XX.XX.XX.74 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node14 | XX.XX.XX.87 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node15 | XX.XX.XX.85 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node16 | XX.XX.XX.86 | 1 | UNAVAILABLE | | |
---------------------------------------------------------------------------------------------------------------
| node17 | XX.XX.XX.91 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node18 | XX.XX.XX.84 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node19 | XX.XX.XX.89 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node20 | XX.XX.XX.90 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
节点替换
由于9.5.3是管理,调度,计算服务支持独立部署的,所以节点替换操作也是各自独立的。
所有操作均在dbauser下进行,一般是操作系统gbase用户。
环境准备
虽然953与86版本差别较大,但对于环境的一些要求还是有参考性的。
准备替换
在任意一台调度节点(coordinator),解压缩集群的安装包,并进入解压后的gcinstall目录,确认集群版本与压缩包的BUILD文件内容相符。
其中svn的号要匹配,如下例子是 0fa78d1。
如果部分服务打过补丁,svn号可能不同,请先确认,并注意后续打补丁操作千万别忘了。
[gbase@gbase_rh7_003 gcinstall]$ cat BUILDINFO
release_version = 9.5.3.27.14
revision = 0fa78d1
os_ventor = centos7
arch = x86_64
build_version = release
license = none
install_revision: 0fa78d1
autobuild_revision: 0fa78d1
monit_revision: 0fa78d1
gcrcman_revision: 0fa78d1
corosync_revision: 0fa78d1
gcware_revision: 0fa78d1
gcluster_revision: 0fa78d1
logCollector_revision: 0fa78d1
GCMonit_revision: 0fa78d1
license_soft_revision: 0fa78d1
gnode_revision: 0fa78d1
[gbase@gbase_rh7_003 gcinstall]$ gclusterd -V
gclusterd ver 9.5.3.27.140fa78d1 for redhat-linux on x86_64
[gbase@gbase_rh7_003 gcinstall]$ gbased -V
gbased ver 9.5.3.27.140fa78d1 for redhat-linux on x86_64
[gbase@gbase_rh7_003 gcinstall]$ gcware -v
GBASE Cluster Consist Service Engine, version 9.5.0fa78d1
Copyright (c) 2017 -2020 GBASE, Inc.
[gbase@gbase_rh7_003 gcinstall]$
替换管理服务gcware
对76节点做管理服务(gcware)的替换。
进入gcware服务gcware_server目录下,执行如下操作
./gcserver.py --prefix=/data --host=XX.XX.XX.76 --dbaUser=gbase --dbaPwd=XXXX --overwrite
其中
- --host是要替换的管理服务IP,如有多个用逗号分割
- --dbaUser是数据库的操作系统用户名,一般是gbase
- --dbaPwd是数据库的操作系统用户密码
- --overwrite是强制覆盖模式,如有残留会自动覆盖或删除
执行过程如下
[gbase@bd48db02 gcware_server]$ ./gcserver.py --prefix=/data --host=XX.XX.XX.76 --dbaUser=gbase --dbaPwd=XXXX --overwrite
XX.XX.XX.76
Are you sure to replace install these nodes ([Y,y]/[N,n])? y
Stop all gcware nodes...
UnInstall all gcware nodes...
scp gcware tar to replaced nodes...
Starting replace all gcware nodes...
sync gcware config...
Starting all gcware nodes...
Starting to clear gcware info...
replace cluster successful.
执行后结果如下,可以看到76节点的gcware服务已经从CLOSE转为OPEN状态
[gbase@bd48db02 gcware_server]$ gcadmin
CLUSTER STATE: ACTIVE
VIRTUAL CLUSTER MODE: NORMAL
====================================
| GBASE GCWARE CLUSTER INFORMATION |
====================================
| NodeName | IpAddress | gcware |
------------------------------------
| gcware1 | XX.XX.XX.72 | OPEN |
------------------------------------
| gcware2 | XX.XX.XX.73 | OPEN |
------------------------------------
| gcware3 | XX.XX.XX.74 | OPEN |
------------------------------------
| gcware4 | XX.XX.XX.75 | OPEN |
------------------------------------
| gcware5 | XX.XX.XX.76 | OPEN |
------------------------------------
| gcware6 | XX.XX.XX.77 | OPEN |
------------------------------------
| gcware7 | XX.XX.XX.78 | OPEN |
------------------------------------
========================================================
| GBASE COORDINATOR CLUSTER INFORMATION |
========================================================
| NodeName | IpAddress | gcluster | DataState |
--------------------------------------------------------
| coordinator1 | XX.XX.XX.72 | OPEN | 0 |
--------------------------------------------------------
| coordinator2 | XX.XX.XX.73 | OPEN | 0 |
--------------------------------------------------------
| coordinator3 | XX.XX.XX.74 | OPEN | 0 |
--------------------------------------------------------
| coordinator4 | XX.XX.XX.75 | OPEN | 0 |
--------------------------------------------------------
| coordinator5 | XX.XX.XX.76 | UNAVAILABLE | |
--------------------------------------------------------
| coordinator6 | XX.XX.XX.77 | OPEN | 0 |
--------------------------------------------------------
| coordinator7 | XX.XX.XX.78 | OPEN | 0 |
--------------------------------------------------------
===============================================================================================================
| GBASE DATA CLUSTER INFORMATION |
===============================================================================================================
| NodeName | IpAddress | DistributionId | gnode | syncserver | DataState |
---------------------------------------------------------------------------------------------------------------
| node1 | XX.XX.XX.82 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node2 | XX.XX.XX.83 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node3 | XX.XX.XX.88 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node4 | XX.XX.XX.81 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node5 | XX.XX.XX.80 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node6 | XX.XX.XX.77 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node7 | XX.XX.XX.76 | 1 | UNAVAILABLE | | |
---------------------------------------------------------------------------------------------------------------
| node8 | XX.XX.XX.79 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node9 | XX.XX.XX.78 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node10 | XX.XX.XX.73 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node11 | XX.XX.XX.72 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node12 | XX.XX.XX.75 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node13 | XX.XX.XX.74 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node14 | XX.XX.XX.87 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node15 | XX.XX.XX.85 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node16 | XX.XX.XX.86 | 1 | UNAVAILABLE | | |
---------------------------------------------------------------------------------------------------------------
| node17 | XX.XX.XX.91 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node18 | XX.XX.XX.84 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node19 | XX.XX.XX.89 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node20 | XX.XX.XX.90 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
[gbase@bd48db02 gcware_server]$
替换调度服务
对76节点做调度服务(coordinator)做替换。
命令如下
./replace.py --host=XX.XX.XX.76 --type=coor --dbaUser=gbase --dbaUserPwd=YYYY --generalDBUse=gbase --license_file=/home/gbase/20220706-20.lic --parallel_pack=1 --retry_times=0 --overwrite --sync_coordi_metadata_timeout=30000
- --host 要替换的节点IP,如有多个用逗号分割
- --type 替换的服务类型, coor是调度,data是计算。本部分是coor调度服务替换
- --dbaUser是数据库的操作系统用户名,一般是gbase
- --dbaPwd是数据库的操作系统用户密码
- --generalDBUse 是数据库内管理员用户的用户名,一般可以是root或者gbase. 请注意区分操作用户和数据库用户
- --license_file 许可证文件,在当前节点可见即可,替换程序会自动复制到目标节点上。
- --parallel_pack 开启并行打包
- --retry_times 重试次数,除非环境问题导致的报错,个人不建议重试,还是先解决问题后再重新执行替换。
- --overwrite是强制覆盖模式,如有残留会自动覆盖或删除
- --sync_coordi_metadata_timeout 同步coor元数据的超时时间,单位是分钟,默认是15分钟,如果表很多,比如几百万,建议改大,比如30000分钟。
执行过程如下
[gbase@bd48db02 gcinstall]$ ./replace.py --host=XX.XX.XX.76 --type=coor --dbaUser=gbase --dbaUserPwd=YYYY --generalDBUse=gbase --license_file=/home/gbase/20220706-20.lic --parallel_pack=1 --retry_times=0 --overwrite --sync_coordi_metadata_timeout=30000
install prefix: /data/XX.XX.XX.73
execute replace node os user: gbase
replaced nodes: ['XX.XX.XX.76']
replace node type: coor
IsAutoGcware: True
coordinator hosts: ['XX.XX.XX.72', 'XX.XX.XX.73', 'XX.XX.XX.74', 'XX.XX.XX.75', 'XX.XX.XX.76', 'XX.XX.XX.77', 'XX.XX.XX.78']
IP: XX.XX.XX.82
IP: XX.XX.XX.83
IP: XX.XX.XX.88
IP: XX.XX.XX.81
IP: XX.XX.XX.80
IP: XX.XX.XX.77
IP: XX.XX.XX.76
IP: XX.XX.XX.79
IP: XX.XX.XX.78
IP: XX.XX.XX.73
IP: XX.XX.XX.72
IP: XX.XX.XX.75
IP: XX.XX.XX.74
IP: XX.XX.XX.87
IP: XX.XX.XX.85
IP: XX.XX.XX.86
IP: XX.XX.XX.91
IP: XX.XX.XX.84
IP: XX.XX.XX.89
IP: XX.XX.XX.90
data hosts: ['XX.XX.XX.82', 'XX.XX.XX.83', 'XX.XX.XX.88', 'XX.XX.XX.81', 'XX.XX.XX.80', 'XX.XX.XX.77', 'XX.XX.XX.76', 'XX.XX.XX.79', '14.38.0.87', 'XX.XX.XX.85', 'XX.XX.XX.86', 'XX.XX.XX.91', 'XX.XX.XX.84', 'XX.XX.XX.89', 'XX.XX.XX.90']
freenode hosts: []
node address type: IPV4
localHost is: XX.XX.XX.73
gcware mode: single vc mode
host XX.XX.XX.76 node state: REPLACE
check login all host
XX.XX.XX.76
Are you sure to replace install these nodes ([Y,y]/[N,n])? y
check database user and password ...
check database user and password successful
XX.XX.XX.76 os type is CentOS
checking rpms ...
uninstall host ['XX.XX.XX.76'] begin
uninstall host ['XX.XX.XX.76'] end
install host ['XX.XX.XX.76'] begin
mkdir /data/XX.XX.XX.76/cluster_prepare on host XX.XX.XX.76.
Copying /home/gbase/gcinstall/XX.XX.XX.76.options to host XX.XX.XX.76:/data/XX.XX.XX.76/cluster_prepare
Copying data files to host XX.XX.XX.76 successfully
send install command: /usr/bin/python /data/XX.XX.XX.76/cluster_prepare/InstallTar.py --silent=/data/XX.XX.XX.76/cluster_prepare/214.3deid=1275078358 --uuid=4be7a2a6-71c4-11ec-b83c-bc1695246f41
install host ['XX.XX.XX.76'] end
sync cluster config file begin
sync cluster config file end
sync kerberos file begin
sync kerberos file end
Import license...
Starting all gcluster nodes ...
start cluster service failed on host XX.XX.XX.76.
check rsync command status on available coordinator and replaced coordinator
replace node will use scp command sync metadata .....
Begin to exec gcadmin replacenodes ...
check ip start ......
check ip end ......
switch cluster mode into READONLY start ......
wait all ddl statement stop ......
all ddl statement stoped
switch cluster mode into READONLY end ......
delete all fevent log on replace nodes start ......
delete ddl event log on node XX.XX.XX.76 start
delete ddl event log on node XX.XX.XX.76 end
delete dml event log on node XX.XX.XX.76 start
delete dml event log on node XX.XX.XX.76 end
delete dml storage event log on node XX.XX.XX.76 start
delete dml storage event log on node XX.XX.XX.76 end
delete all fevent log on replace nodes end ......
sync coordinator metedata start ......
parallel build data packet start ......
parallel build data packet end ......
parallel copy data packet start ......
parallel copy data packet end ......
copy plugin start ......
copy plugin end ......
uncompress data packet start ......
uncompress data packet end ......
clear temporary file start ......
clear temporary file end ......
sync coordinator metedata end ......
sync coordinator metedata end,spend time 429943 ms......
restore node state start ......
restore node state end ......
replace nodes spend time: 459955 ms
all nodes replace success end
Replace gcluster nodes successfully.
[gbase@bd48db02 gcinstall]$
管理服务替换结果,76节点的coordinator管理服务,从UNAVAILABLE变成OPEN。
[gbase@bd48db02 gcinstall]$ gcadmin
CLUSTER STATE: ACTIVE
VIRTUAL CLUSTER MODE: NORMAL
====================================
| GBASE GCWARE CLUSTER INFORMATION |
====================================
| NodeName | IpAddress | gcware |
------------------------------------
| gcware1 | XX.XX.XX.72 | OPEN |
------------------------------------
| gcware2 | XX.XX.XX.73 | OPEN |
------------------------------------
| gcware3 | XX.XX.XX.74 | OPEN |
------------------------------------
| gcware4 | XX.XX.XX.75 | OPEN |
------------------------------------
| gcware5 | XX.XX.XX.76 | OPEN |
------------------------------------
| gcware6 | XX.XX.XX.77 | OPEN |
------------------------------------
| gcware7 | XX.XX.XX.78 | OPEN |
------------------------------------
=====================================================
| GBASE COORDINATOR CLUSTER INFORMATION |
=====================================================
| NodeName | IpAddress | gcluster | DataState |
-----------------------------------------------------
| coordinator1 | XX.XX.XX.72 | OPEN | 0 |
-----------------------------------------------------
| coordinator2 | XX.XX.XX.73 | OPEN | 0 |
-----------------------------------------------------
| coordinator3 | XX.XX.XX.74 | OPEN | 0 |
-----------------------------------------------------
| coordinator4 | XX.XX.XX.75 | OPEN | 0 |
-----------------------------------------------------
| coordinator5 | XX.XX.XX.76 | OPEN | 0 |
-----------------------------------------------------
| coordinator6 | XX.XX.XX.77 | OPEN | 0 |
-----------------------------------------------------
| coordinator7 | XX.XX.XX.78 | OPEN | 0 |
-----------------------------------------------------
===============================================================================================================
| GBASE DATA CLUSTER INFORMATION |
===============================================================================================================
| NodeName | IpAddress | DistributionId | gnode | syncserver | DataState |
---------------------------------------------------------------------------------------------------------------
| node1 | XX.XX.XX.82 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node2 | XX.XX.XX.83 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node3 | XX.XX.XX.88 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node4 | XX.XX.XX.81 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node5 | XX.XX.XX.80 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node6 | XX.XX.XX.77 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node7 | XX.XX.XX.76 | 1 | UNAVAILABLE | | |
---------------------------------------------------------------------------------------------------------------
| node8 | XX.XX.XX.79 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node9 | XX.XX.XX.78 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node10 | XX.XX.XX.73 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node11 | XX.XX.XX.72 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node12 | XX.XX.XX.75 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node13 | XX.XX.XX.74 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node14 | XX.XX.XX.87 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node15 | XX.XX.XX.85 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node16 | XX.XX.XX.86 | 1 | UNAVAILABLE | | |
---------------------------------------------------------------------------------------------------------------
| node17 | XX.XX.XX.91 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node18 | XX.XX.XX.84 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node19 | XX.XX.XX.89 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
| node20 | XX.XX.XX.90 | 1 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------------
[gbase@bd48db02 gcinstall]$
替换数据计算服务
这部分较复杂,与标准的95版本替换数据计算节点流程一致,可参考 GBase 8a V95版本节点替换操作手顺
如下只贴出操作过程,不再详细解释。
生成中间分布策略
gcChangeInfo_1.xml 和 distribution_info_2.xml。
其中分布策略里的76和86相关的内容做了调整。
[gbase@localhost gcinstall]$ cat gcChangeInfo_1.xml
<?xml version="1.0" encoding="utf-8"?>
<servers>
<cfgFile file="distribution_info_2.xml"/>
</servers>
[gbase@localhost gcinstall]$
[gbase@bd48db02 gcinstall]$ cat distribution_info_2.xml
<?xml version='1.0' encoding="utf-8"?>
<distributions>
<distribution>
<segments>
<segment>
<primarynode ip="XX.XX.XX.72"/>
<duplicatenodes>
<duplicatenode ip="XX.XX.XX.73"/>
<duplicatenode ip="XX.XX.XX.74"/>
</duplicatenodes>
</segment>
<segment>
<primarynode ip="XX.XX.XX.73"/>
<duplicatenodes>
<duplicatenode ip="XX.XX.XX.74"/>
<duplicatenode ip="XX.XX.XX.75"/>
</duplicatenodes>
</segment>
<segment>
<primarynode ip="XX.XX.XX.74"/>
<duplicatenodes>
<duplicatenode ip="XX.XX.XX.75"/>
</duplicatenodes>
</segment>
<segment>
<primarynode ip="XX.XX.XX.75"/>
<duplicatenodes>
<duplicatenode ip="XX.XX.XX.77"/>
</duplicatenodes>
</segment>
<segment>
<primarynode ip="XX.XX.XX.77"/>
<duplicatenodes>
<duplicatenode ip="XX.XX.XX.78"/>
</duplicatenodes>
</segment>
<segment>
<primarynode ip="XX.XX.XX.77"/>
<duplicatenodes>
<duplicatenode ip="XX.XX.XX.78"/>
<duplicatenode ip="XX.XX.XX.79"/>
</duplicatenodes>
</segment>
<segment>
<primarynode ip="XX.XX.XX.78"/>
<duplicatenodes>
<duplicatenode ip="XX.XX.XX.79"/>
<duplicatenode ip="XX.XX.XX.80"/>
</duplicatenodes>
</segment>
<segment>
<primarynode ip="XX.XX.XX.79"/>
<duplicatenodes>
<duplicatenode ip="XX.XX.XX.80"/>
<duplicatenode ip="XX.XX.XX.81"/>
</duplicatenodes>
</segment>
<segment>
<primarynode ip="XX.XX.XX.80"/>
<duplicatenodes>
<duplicatenode ip="XX.XX.XX.81"/>
<duplicatenode ip="XX.XX.XX.82"/>
</duplicatenodes>
</segment>
<segment>
<primarynode ip="XX.XX.XX.81"/>
<duplicatenodes>
<duplicatenode ip="XX.XX.XX.82"/>
<duplicatenode ip="XX.XX.XX.83"/>
</duplicatenodes>
</segment>
<segment>
<primarynode ip="XX.XX.XX.82"/>
<duplicatenodes>
<duplicatenode ip="XX.XX.XX.83"/>
<duplicatenode ip="XX.XX.XX.84"/>
</duplicatenodes>
</segment>
<segment>
<primarynode ip="XX.XX.XX.83"/>
<duplicatenodes>
<duplicatenode ip="XX.XX.XX.84"/>
<duplicatenode ip="XX.XX.XX.85"/>
</duplicatenodes>
</segment>
<segment>
<primarynode ip="XX.XX.XX.84"/>
<duplicatenodes>
<duplicatenode ip="XX.XX.XX.85"/>
</duplicatenodes>
</segment>
<segment>
<primarynode ip="XX.XX.XX.85"/>
<duplicatenodes>
<duplicatenode ip="XX.XX.XX.87"/>
</duplicatenodes>
</segment>
<segment>
<primarynode ip="XX.XX.XX.87"/>
<duplicatenodes>
<duplicatenode ip="XX.XX.XX.88"/>
</duplicatenodes>
</segment>
<segment>
<primarynode ip="XX.XX.XX.87"/>
<duplicatenodes>
<duplicatenode ip="XX.XX.XX.88"/>
<duplicatenode ip="XX.XX.XX.89"/>
</duplicatenodes>
</segment>
<segment>
<primarynode ip="XX.XX.XX.88"/>
<duplicatenodes>
<duplicatenode ip="XX.XX.XX.89"/>
<duplicatenode ip="XX.XX.XX.90"/>
</duplicatenodes>
</segment>
<segment>
<primarynode ip="XX.XX.XX.89"/>
<duplicatenodes>
<duplicatenode ip="XX.XX.XX.90"/>
<duplicatenode ip="XX.XX.XX.91"/>
</duplicatenodes>
</segment>
<segment>
<primarynode ip="XX.XX.XX.90"/>
<duplicatenodes>
<duplicatenode ip="XX.XX.XX.91"/>
<duplicatenode ip="XX.XX.XX.72"/>
</duplicatenodes>
</segment>
<segment>
<primarynode ip="XX.XX.XX.91"/>
<duplicatenodes>
<duplicatenode ip="XX.XX.XX.72"/>
<duplicatenode ip="XX.XX.XX.73"/>
</duplicatenodes>
</segment>
</segments>
</distribution>
</distributions>
生成中间分布策略
[gbase@bd48db02 gcinstall]$ gcadmin distribution gcChangeInfo_1.xml
gcadmin generate distribution ...
gcadmin generate distribution successful
[gbase@bd48db02 gcinstall]$ gcadmin showdistribution
Distribution ID: 2 | State: new | Total segment num: 20
Primary Segment Node IP Segment ID Duplicate Segment node IP
========================================================================================================================
| XX.XX.XX.72 | 1 | XX.XX.XX.73 |
| | | XX.XX.XX.74 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.73 | 2 | XX.XX.XX.74 |
| | | XX.XX.XX.75 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.74 | 3 | XX.XX.XX.75 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.75 | 4 | XX.XX.XX.77 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.77 | 5 | XX.XX.XX.78 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.77 | 6 | XX.XX.XX.78 |
| | | XX.XX.XX.79 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.78 | 7 | XX.XX.XX.79 |
| | | XX.XX.XX.80 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.79 | 8 | XX.XX.XX.80 |
| | | XX.XX.XX.81 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.80 | 9 | XX.XX.XX.81 |
| | | XX.XX.XX.82 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.81 | 10 | XX.XX.XX.82 |
| | | XX.XX.XX.83 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.82 | 11 | XX.XX.XX.83 |
| | | XX.XX.XX.84 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.83 | 12 | XX.XX.XX.84 |
| | | XX.XX.XX.85 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.84 | 13 | XX.XX.XX.85 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.85 | 14 | XX.XX.XX.87 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.87 | 15 | XX.XX.XX.88 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.87 | 16 | XX.XX.XX.88 |
| | | XX.XX.XX.89 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.88 | 17 | XX.XX.XX.89 |
| | | XX.XX.XX.90 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.89 | 18 | XX.XX.XX.90 |
| | | XX.XX.XX.91 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.90 | 19 | XX.XX.XX.91 |
| | | XX.XX.XX.72 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.91 | 20 | XX.XX.XX.72 |
| | | XX.XX.XX.73 |
========================================================================================================================
Distribution ID: 1 | State: old | Total segment num: 20
Primary Segment Node IP Segment ID Duplicate Segment node IP
========================================================================================================================
| XX.XX.XX.72 | 1 | XX.XX.XX.73 |
| | | XX.XX.XX.74 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.73 | 2 | XX.XX.XX.74 |
| | | XX.XX.XX.75 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.74 | 3 | XX.XX.XX.75 |
| | | XX.XX.XX.76 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.75 | 4 | XX.XX.XX.76 |
| | | XX.XX.XX.77 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.76 | 5 | XX.XX.XX.77 |
| | | XX.XX.XX.78 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.77 | 6 | XX.XX.XX.78 |
| | | XX.XX.XX.79 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.78 | 7 | XX.XX.XX.79 |
| | | XX.XX.XX.80 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.79 | 8 | XX.XX.XX.80 |
| | | XX.XX.XX.81 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.80 | 9 | XX.XX.XX.81 |
| | | XX.XX.XX.82 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.81 | 10 | XX.XX.XX.82 |
| | | XX.XX.XX.83 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.82 | 11 | XX.XX.XX.83 |
| | | XX.XX.XX.84 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.83 | 12 | XX.XX.XX.84 |
| | | XX.XX.XX.85 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.84 | 13 | XX.XX.XX.85 |
| | | XX.XX.XX.86 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.85 | 14 | XX.XX.XX.86 |
| | | XX.XX.XX.87 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.86 | 15 | XX.XX.XX.87 |
| | | XX.XX.XX.88 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.87 | 16 | XX.XX.XX.88 |
| | | XX.XX.XX.89 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.88 | 17 | XX.XX.XX.89 |
| | | XX.XX.XX.90 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.89 | 18 | XX.XX.XX.90 |
| | | XX.XX.XX.91 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.90 | 19 | XX.XX.XX.91 |
| | | XX.XX.XX.72 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.91 | 20 | XX.XX.XX.72 |
| | | XX.XX.XX.73 |
========================================================================================================================
[gbase@bd48db02 gcinstall]$
初始化并重分布中间策略
[gbase@bd48db02 gcinstall]$ gccli -pgbase20220228
GBase client 9.5.3.26.5dad792a. Copyright (c) 2004-2022, GBase. All Rights Reserved.
gbase> initnodedatamap;
Query OK, 0 rows affected, 368 warnings (Elapsed: 00:00:00.83)
gbase> rebalance instance;
Query OK, 10021 rows affected (Elapsed: 00:00:01.35)
gbase>
等待重分布完成。
准备工作已经完成,此处千万不要删除老的策略
数据计算节点替换操作
其中host有2个,用逗号分割。 type是data。
[gbase@bd48db02 gcinstall]$ ./replace.py --host=XX.XX.XX.76,XX.XX.XX.86 --type=data --dbaUser=gbase --dbaUserPwd=YYYY --generalDBUse=gbase --generalDBPwd=gbase20220228 --overwrite --license_file=/home/gbase/20220706-20.lic --retry_times=0
install prefix: /data/XX.XX.XX.73
execute replace node os user: gbase
replaced nodes: ['XX.XX.XX.76', 'XX.XX.XX.86']
replace node type: data
IsAutoGcware: True
coordinator hosts: ['XX.XX.XX.72', 'XX.XX.XX.73', 'XX.XX.XX.74', 'XX.XX.XX.75', 'XX.XX.XX.76', 'XX.XX.XX.77', 'XX.XX.XX.78']
IP: XX.XX.XX.82
IP: XX.XX.XX.83
IP: XX.XX.XX.88
IP: XX.XX.XX.81
IP: XX.XX.XX.80
IP: XX.XX.XX.77
IP: XX.XX.XX.76
IP: XX.XX.XX.79
IP: XX.XX.XX.78
IP: XX.XX.XX.73
IP: XX.XX.XX.72
IP: XX.XX.XX.75
IP: XX.XX.XX.74
IP: XX.XX.XX.87
IP: XX.XX.XX.85
IP: XX.XX.XX.86
IP: XX.XX.XX.91
IP: XX.XX.XX.84
IP: XX.XX.XX.89
IP: XX.XX.XX.90
data hosts: ['XX.XX.XX.82', 'XX.XX.XX.83', 'XX.XX.XX.88', 'XX.XX.XX.81', 'XX.XX.XX.80', 'XX.XX.XX.77', 'XX.XX.XX.76', 'XX.XX.XX.79', 'XX.XX.XX.78', 'XX.XX.XX.73', 'XX.XX.XX.72', 'XX.XX.XX.75', 'XX.XX.XX.74', 'XX.XX.XX.87', 'XX.XX.XX.85', 'XX.XX.XX.86', 'XX.XX.XX.91', 'XX.XX.XX.84', 'XX.XX.XX.89', 'XX.XX.XX.90']
freenode hosts: []
node address type: IPV4
localHost is: XX.XX.XX.73
gcware mode: single vc mode
host XX.XX.XX.76 node state: UNAVAILABLE
host XX.XX.XX.86 node state: UNAVAILABLE
host XX.XX.XX.76 node state: UNAVAILABLE
host XX.XX.XX.86 node state: UNAVAILABLE
check login all host
XX.XX.XX.76 XX.XX.XX.86
Are you sure to replace install these nodes ([Y,y]/[N,n])? y
\check database user and password ...
check database user and password successful
check cluster distribution ...
check cluster distribution successful
XX.XX.XX.86 os type is CentOS
XX.XX.XX.76 os type is CentOS
checking rpms ...
uninstall host ['XX.XX.XX.76', 'XX.XX.XX.86'] begin
uninstall host ['XX.XX.XX.76', 'XX.XX.XX.86'] end
install host ['XX.XX.XX.76', 'XX.XX.XX.86'] begin
mkdir /data/XX.XX.XX.86/cluster_prepare on host XX.XX.XX.86.
mkdir /data/XX.XX.XX.76/cluster_prepare on host XX.XX.XX.76.
Copying /home/gbase/gcinstall/XX.XX.XX.86.options to host XX.XX.XX.86:/data/XX.XX.XX.86/cluster_prepare
Copying /home/gbase/gcinstall/XX.XX.XX.76.options to host XX.XX.XX.76:/data/XX.XX.XX.76/cluster_prepare
Copying data files to host XX.XX.XX.86 successfully
Copying data files to host XX.XX.XX.76 successfully
send install command: /usr/bin/python /data/XX.XX.XX.86/cluster_prepare/InstallTar.py --silent=/data/XX.XX.XX.86/cluster_prepare/XX.XX.XX.86.options --IsData --type=data --IsAutoGcware --uuid=4be7a2a6-71c4-11ec-b83c-bc1695246f41
send install command: /usr/bin/python /data/XX.XX.XX.76/cluster_prepare/InstallTar.py --silent=/data/XX.XX.XX.76/cluster_prepare/XX.XX.XX.76.options --IsCoordinator --IsData --type=data --IsAutoGcware --uuid=4be7a2a6-71c4-11ec-b83c-bc1695246f41
install host ['XX.XX.XX.76', 'XX.XX.XX.86'] end
sync cluster config file begin
sync cluster config file end
sync kerberos file begin
sync kerberos file end
Import license...
Starting all gcluster nodes ...
Begin to exec gcadmin replacenodes ...
check ip start ......
check ip end ......
switch cluster mode into READONLY start ......
wait all ddl statement stop ......
all ddl statement stoped
switch cluster mode into READONLY end ......
delete all fevent log on replace nodes start ......
delete ddl event log on node XX.XX.XX.76 start
delete ddl event log on node XX.XX.XX.76 end
delete dml event log on node XX.XX.XX.76 start
delete dml event log on node XX.XX.XX.76 end
delete dml storage event log on node XX.XX.XX.76 start
delete dml storage event log on node XX.XX.XX.76 end
delete ddl event log on node XX.XX.XX.86 start
delete ddl event log on node XX.XX.XX.86 end
delete dml event log on node XX.XX.XX.86 start
delete dml event log on node XX.XX.XX.86 end
delete dml storage event log on node XX.XX.XX.86 start
delete dml storage event log on node XX.XX.XX.86 end
delete all fevent log on replace nodes end ......
sync dataserver metedata begin ......
copy script to data node begin
copy script to data node end
build data packet begin
build data packet end
copy data packet to target node begin
copy data packet to target node end
extract data packet begin
extract data packet end
sync dataserver metedata end, spend time 11177 ms ......
create distribution begin ......
remove old distribution begin
remove old distribution end
create new distribution begin
restore node state start ......
restore node state end ......
create new distribution end
replace node initnodedatamap
create distribution end
replace nodes spend time: 43304 ms
synchronize data node metadata success
please rebalance instance then remove old distribution after rebalance complete success
Replace gcluster nodes successfully.
[gbase@bd48db02 gcinstall]$
数据计算节点替换后效果,其中76和86的状态从UNAVAILABLE变成OPEN。注意其与其它节点差异,分布策略只有最新的3,而没有中间策略2。
[gbase@bd48db02 gcinstall]$ gcadmin
CLUSTER STATE: ACTIVE
VIRTUAL CLUSTER MODE: NORMAL
====================================
| GBASE GCWARE CLUSTER INFORMATION |
====================================
| NodeName | IpAddress | gcware |
------------------------------------
| gcware1 | XX.XX.XX.72 | OPEN |
------------------------------------
| gcware2 | XX.XX.XX.73 | OPEN |
------------------------------------
| gcware3 | XX.XX.XX.74 | OPEN |
------------------------------------
| gcware4 | XX.XX.XX.75 | OPEN |
------------------------------------
| gcware5 | XX.XX.XX.76 | OPEN |
------------------------------------
| gcware6 | XX.XX.XX.77 | OPEN |
------------------------------------
| gcware7 | XX.XX.XX.78 | OPEN |
------------------------------------
=====================================================
| GBASE COORDINATOR CLUSTER INFORMATION |
=====================================================
| NodeName | IpAddress | gcluster | DataState |
-----------------------------------------------------
| coordinator1 | XX.XX.XX.72 | OPEN | 0 |
-----------------------------------------------------
| coordinator2 | XX.XX.XX.73 | OPEN | 0 |
-----------------------------------------------------
| coordinator3 | XX.XX.XX.74 | OPEN | 0 |
-----------------------------------------------------
| coordinator4 | XX.XX.XX.75 | OPEN | 0 |
-----------------------------------------------------
| coordinator5 | XX.XX.XX.76 | OPEN | 0 |
-----------------------------------------------------
| coordinator6 | XX.XX.XX.77 | OPEN | 0 |
-----------------------------------------------------
| coordinator7 | XX.XX.XX.78 | OPEN | 0 |
-----------------------------------------------------
=========================================================================================================
| GBASE DATA CLUSTER INFORMATION |
=========================================================================================================
| NodeName | IpAddress | DistributionId | gnode | syncserver | DataState |
---------------------------------------------------------------------------------------------------------
| node1 | XX.XX.XX.82 | 2,3 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------
| node2 | XX.XX.XX.83 | 2,3 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------
| node3 | XX.XX.XX.88 | 2,3 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------
| node4 | XX.XX.XX.81 | 2,3 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------
| node5 | XX.XX.XX.80 | 2,3 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------
| node6 | XX.XX.XX.77 | 2,3 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------
| node7 | XX.XX.XX.76 | 3 | OPEN | OPEN | 1 |
---------------------------------------------------------------------------------------------------------
| node8 | XX.XX.XX.79 | 2,3 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------
| node9 | XX.XX.XX.78 | 2,3 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------
| node10 | XX.XX.XX.73 | 2,3 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------
| node11 | XX.XX.XX.72 | 2,3 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------
| node12 | XX.XX.XX.75 | 2,3 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------
| node13 | XX.XX.XX.74 | 2,3 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------
| node14 | XX.XX.XX.87 | 2,3 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------
| node15 | XX.XX.XX.85 | 2,3 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------
| node16 | XX.XX.XX.86 | 3 | OPEN | OPEN | 1 |
---------------------------------------------------------------------------------------------------------
| node17 | XX.XX.XX.91 | 2,3 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------
| node18 | XX.XX.XX.84 | 2,3 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------
| node19 | XX.XX.XX.89 | 2,3 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------
| node20 | XX.XX.XX.90 | 2,3 | OPEN | OPEN | 0 |
---------------------------------------------------------------------------------------------------------
查看分布策略
[gbase@bd48db02 gcinstall]$ gcadmin showdistribution
Distribution ID: 3 | State: new | Total segment num: 20
Primary Segment Node IP Segment ID Duplicate Segment node IP
========================================================================================================================
| XX.XX.XX.72 | 1 | XX.XX.XX.73 |
| | | XX.XX.XX.74 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.73 | 2 | XX.XX.XX.74 |
| | | XX.XX.XX.75 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.74 | 3 | XX.XX.XX.75 |
| | | XX.XX.XX.76 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.75 | 4 | XX.XX.XX.76 |
| | | XX.XX.XX.77 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.76 | 5 | XX.XX.XX.77 |
| | | XX.XX.XX.78 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.77 | 6 | XX.XX.XX.78 |
| | | XX.XX.XX.79 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.78 | 7 | XX.XX.XX.79 |
| | | XX.XX.XX.80 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.79 | 8 | XX.XX.XX.80 |
| | | XX.XX.XX.81 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.80 | 9 | XX.XX.XX.81 |
| | | XX.XX.XX.82 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.81 | 10 | XX.XX.XX.82 |
| | | XX.XX.XX.83 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.82 | 11 | XX.XX.XX.83 |
| | | XX.XX.XX.84 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.83 | 12 | XX.XX.XX.84 |
| | | XX.XX.XX.85 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.84 | 13 | XX.XX.XX.85 |
| | | XX.XX.XX.86 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.85 | 14 | XX.XX.XX.86 |
| | | XX.XX.XX.87 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.86 | 15 | XX.XX.XX.87 |
| | | XX.XX.XX.88 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.87 | 16 | XX.XX.XX.88 |
| | | XX.XX.XX.89 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.88 | 17 | XX.XX.XX.89 |
| | | XX.XX.XX.90 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.89 | 18 | XX.XX.XX.90 |
| | | XX.XX.XX.91 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.90 | 19 | XX.XX.XX.91 |
| | | XX.XX.XX.72 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.91 | 20 | XX.XX.XX.72 |
| | | XX.XX.XX.73 |
========================================================================================================================
Distribution ID: 2 | State: old | Total segment num: 20
Primary Segment Node IP Segment ID Duplicate Segment node IP
========================================================================================================================
| XX.XX.XX.72 | 1 | XX.XX.XX.73 |
| | | XX.XX.XX.74 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.73 | 2 | XX.XX.XX.74 |
| | | XX.XX.XX.75 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.74 | 3 | XX.XX.XX.75 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.75 | 4 | XX.XX.XX.77 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.77 | 5 | XX.XX.XX.78 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.77 | 6 | XX.XX.XX.78 |
| | | XX.XX.XX.79 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.78 | 7 | XX.XX.XX.79 |
| | | XX.XX.XX.80 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.79 | 8 | XX.XX.XX.80 |
| | | XX.XX.XX.81 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.80 | 9 | XX.XX.XX.81 |
| | | XX.XX.XX.82 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.81 | 10 | XX.XX.XX.82 |
| | | XX.XX.XX.83 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.82 | 11 | XX.XX.XX.83 |
| | | XX.XX.XX.84 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.83 | 12 | XX.XX.XX.84 |
| | | XX.XX.XX.85 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.84 | 13 | XX.XX.XX.85 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.85 | 14 | XX.XX.XX.87 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.87 | 15 | XX.XX.XX.88 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.87 | 16 | XX.XX.XX.88 |
| | | XX.XX.XX.89 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.88 | 17 | XX.XX.XX.89 |
| | | XX.XX.XX.90 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.89 | 18 | XX.XX.XX.90 |
| | | XX.XX.XX.91 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.90 | 19 | XX.XX.XX.91 |
| | | XX.XX.XX.72 |
------------------------------------------------------------------------------------------------------------------------
| XX.XX.XX.91 | 20 | XX.XX.XX.72 |
| | | XX.XX.XX.73 |
========================================================================================================================
[gbase@bd48db02 gcinstall]$
打补丁
如果集群有打过临时补丁,此时是最何时机。
重分布数据
从如下操作可以看出,前面的节点替换完成后,已经自动做了。其中并行度请根据系统情况调整。
[gbase@bd48db02 gcinstall]$ gccli -pgbase20220228
GBase client 9.5.3.26.5dad792a. Copyright (c) 2004-2022, GBase. All Rights Reserved.
gbase> initnodedatamap;
ERROR 1707 (HY000): gcluster command error: (GBA-02CO-0004) nodedatamap is already initialized.
gbase>
gbase> set global gcluster_rebalancing_concurrent_count=2;
Query OK, 0 rows affected (Elapsed: 00:00:00.01)
gbase> rebalance instance;
Query OK, 10023 rows affected (Elapsed: 00:00:01.08)
删除老的分布策略
重分布完成后,删除老的分布策略。
在数据库命令行,用SQL删掉老的nodedatamap
refreshnodedatamap drop 2
在操作系统命令行,删掉老的distribution
gcadmin rmdistribution 2
总结
9.5.3的节点替换,除了管理集群(gcware)需要额外操作外,其余的与9.5.2操作完全一样。