GBase 8a
运维管理
文章

关于一次简单的v953节点替换的测试

发表于2024-12-31 11:50:2915次浏览2个评论

953 复合节点节点替换,先替换gcware 在替换 gclusterd 最后替换 gnode

[gbase@node1 gcinstall]$ gcadmin
CLUSTER STATE:         ACTIVE
VIRTUAL CLUSTER MODE:  NORMAL

======================================
|  GBASE GCWARE CLUSTER INFORMATION  |
======================================
| NodeName |   IpAddress    | gcware |
--------------------------------------
| gcware1  | 192.168.111.50 |  OPEN  |
--------------------------------------
| gcware2  | 192.168.111.51 |  OPEN  |
--------------------------------------
| gcware3  | 192.168.111.52 |  OPEN  |
--------------------------------------
===========================================================
|          GBASE COORDINATOR CLUSTER INFORMATION          |
===========================================================
|   NodeName   |   IpAddress    |  gcluster   | DataState |
-----------------------------------------------------------
| coordinator1 | 192.168.111.50 |    OPEN     |     0     |
-----------------------------------------------------------
| coordinator2 | 192.168.111.51 |    OPEN     |     0     |
-----------------------------------------------------------
| coordinator3 | 192.168.111.52 | UNAVAILABLE |           |
-----------------------------------------------------------
=========================================================================================================
|                                    GBASE DATA CLUSTER INFORMATION                                     |
=========================================================================================================
| NodeName |                IpAddress                 | DistributionId | gnode | syncserver | DataState |
---------------------------------------------------------------------------------------------------------
|  node1   |              192.168.111.51              |       1        | OPEN  |    OPEN    |     0     |
---------------------------------------------------------------------------------------------------------
|  node2   |              192.168.111.50              |       1        | OPEN  |    OPEN    |     0     |
---------------------------------------------------------------------------------------------------------

gcware节点替换;一次只能替换少于一半的节点
1.在可用的gcware节点 进入替换脚本目录
[gbase@node1 ~]$ cd $GCWARE_BASE
[gbase@node1 gcware]$ cd gcware_server
2.替换 192.168.111.52 的gcware
[gbase@node1 gcware_server]$ ./gcserver.py --prefix=/opt --host=192.168.111.52 --dbaUser=gbase --dbaPwd=gbase --overwrite
192.168.111.52
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...
llreplace cluster successful.

替换gclusterd

1指令如下:
[gbase@node1 gcinstall]$ ./replace.py --host=192.168.111.52 --type=coor --dbaUser=gbase --dbaUserPwd=gbase --overwrite --generalDBUser=gbase --generalDBPwd=gbase
信息如下:
install prefix: /opt/192.168.111.50
execute replace node os user: gbase
replaced nodes: ['192.168.111.52']
replace node type: coor
IsAutoGcware: True
coordinator hosts: ['192.168.111.50', '192.168.111.51', '192.168.111.52']
IP: 192.168.111.51
IP: 192.168.111.50
data hosts: ['192.168.111.51', '192.168.111.50']
freenode hosts: []
node address type: IPV4
localHost is: 192.168.111.50
gcware mode: single vc mode
host 192.168.111.52 node state: UNAVAILABLE
check login all host
192.168.111.52
Are you sure to replace install these nodes ([Y,y]/[N,n])? y
check database user and password ...
check database user and password successful
192.168.111.52 os type is CentOS
checking rpms ...
uninstall host ['192.168.111.52'] begin
uninstall host ['192.168.111.52'] end
install host ['192.168.111.52'] begin
mkdir /opt/192.168.111.52/cluster_prepare on host 192.168.111.52.
Copying /opt/gcinstall/192.168.111.52.options to host 192.168.111.52:/opt/192.168.111.52/cluster_prepare
Copying data files to host 192.168.111.52 successfully
send install command: /usr/bin/python /opt/192.168.111.52/cluster_prepare/InstallTar.py --silent=/opt/192.168.111.52/cluster_prepare/192.168.111.52.options --IsCoordinator  --type=coor --IsAutoGcware --localnodeid=879732928 --uuid=60541550-7a58-11ee-8c5f-000c29a6d3ed
install host ['192.168.111.52'] end
sync cluster config file begin
sync cluster config file end
sync kerberos file begin
sync kerberos file end
Starting all gcluster nodes ...
check rsync command status on available coordinator and replaced coordinator
Begin to exec gcadmin replacenodes ...
copy tablespace begin
no user defined tablespace
generate sync command file: /opt/192.168.111.50/gcluster/userdata/replace_coor_file/sync_cmd
copy sync command file to available coordinator
copy sync command file command:scp /opt/192.168.111.50/gcluster/userdata/replace_coor_file/sync_cmd0 gbase@[192.168.111.50]:/opt/192.168.111.50/gcluster/userdata
copy sync command file command:scp /opt/192.168.111.50/gcluster/userdata/replace_coor_file/sync_cmd1 gbase@[192.168.111.51]:/opt/192.168.111.51/gcluster/userdata
copy sync command file command:scp /opt/192.168.111.50/gcluster/userdata/replace_coor_file/sync_cmd gbase@[192.168.111.52]:/opt/192.168.111.52/gcluster/userdata
execute sync gcluster metadata command on coordinator
execute rsync command:[. ~/.gbase_profile && python /opt/192.168.111.50/gcware/bin/gadm_cp_codi_tbl.py exec_rsync 0 *** 300] at node [192.168.111.50]
execute rsync command:[. ~/.gbase_profile && python /opt/192.168.111.51/gcware/bin/gadm_cp_codi_tbl.py exec_rsync 1 *** 300] at node [192.168.111.51]
check target coordinator metadata begin
check target coordinator metadata end
restart target coordinator gclusterd
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 192.168.111.52 start
delete ddl event log on node 192.168.111.52 end
delete dml event log on node 192.168.111.52 start
delete dml event log on node 192.168.111.52 end
delete dml storage event log on node 192.168.111.52 start
delete dml storage event log on node 192.168.111.52 end
delete all fevent log on replace nodes end ......

sync coordinator metedata start ......
sync coordinator metedata end ......
sync coordinator metedata end,spend time 28667 ms......

restore node state start ......
restore node state end ......

replace nodes spend time: 58732 ms

all nodes replace success end
Replace gcluster nodes successfully.
 

评论

登录后才可以发表评论
崔哥发表于 7个月前
我有所念人,隔在远远乡。我有所感事,结在深深肠。乡远去不得,无日不瞻望。肠深解不得,无夕不思量。况此残灯夜,独宿在空堂。秋天殊未晓,风雨正苍苍。不学头陀法,前心安可忘。
GBase用户51935发表于 2个月前
来了