GBase 8a
安装配置
文章

GBase 8a 运维—— 6(缩容)

发表于2024-10-17 15:38:3220次浏览1个评论


(一)、多vc模式
(A)、缩容data节点
1、复制gcChangeInfo.xml ,修改内容,去掉缩容节点
cp gcChangeInfo.xml bakgcChangeInfo.xml
vim gcChangeInfo.xml
2、生成distribution
gcadmin distribution gcChangeInfo.xml p 1 d 1 vc vc1
3、初始化 
use vc vc1
initnodedatamap;
4、执行数据重分布
set global gcluster_rebalancing_concurrent_count=0 # 阻止 rebalance
rebalance instance  #将实例下表加入到 gclusterdb.rebalancing_status
set global gcluster_rebalancing_concurrent_count = 5 ;  # 设置重分布并发数
# select * from gclusterdb.rebalancing_status;  #查看进度
#暂停 重分布,针对表、库、实例
pause rebalance table test.testtable ;
pause rebalance database test;
pause rebalance instance;
#继续重分布,针对表、库、实例 
continue rebalance table test.testtable;
continue rebalance database test;
continue rebalance instance ;
#取消重分布,针对表、库、实例
cancel rebalance table test.testtable;
cancel rebalance database test ;
cancel rebalance instance ;
5、删除旧distribution
#查看旧distributionid
gcadmin showdistribution vc vc1
#确定没有再用旧的id
select index_name,tbname,data_distribution_id,vc_id from gbase.table_distribution;
#删除旧ID (比如vc1中的1)
gcadmin rmdistribution 1 vc vc1
5、从集群中删除缩容节点
#修改为要剔除的节点ip
vim gcChangeInfo.xml
#删除节点
gcadmin rmnodes gcChangeInfo.xml vc1
6、卸载缩容节点
#从freenodes中移除
gcadmin rmnodes gcChangeInfo.xml
#修改demo.options 文件,注释掉没用的,gcware coordinator,停止服务后,卸载这个节点
cp demo.options demo.optionsbak
vim demo.options
gcluster_services all stop
./unInstall.py --silent=demo.options

(B)、缩容coordinator节点
1、修改demo.options 文件,注释掉没用的gcware datahost。
填写coordinator 和exists节点。
cp demo.options demo.optionsbak
vim demo.options
2、停止所有节点服务,卸载这个节点
gcluster_services all stop
gcware_services all stop
./unInstall.py --silent=demo.options
3、启动所有节点
gcluster_services all start
gcware_services all start

(C)、缩容复合节点
1、复制gcChangeInfo.xml ,修改内容,去掉缩容节点,留下要保留节点
cp gcChangeInfo.xml bakgcChangeInfo.xml
vim gcChangeInfo.xml
2、生成distribution
gcadmin distribution gcChangeInfo.xml p 1 d 1 vc vc1
3、初始化 
use vc vc1
initnodedatamap;
4、执行数据重分布
set global gcluster_rebalancing_concurrent_count=0 # 阻止 rebalance
rebalance instance  #将实例下表加入到 gclusterdb.rebalancing_status
set global gcluster_rebalancing_concurrent_count = 5 ;  # 设置重分布并发数
# select * from gclusterdb.rebalancing_status;  #查看进度
#暂停 重分布,针对表、库、实例
pause rebalance table test.testtable ;
pause rebalance database test;
pause rebalance instance;
#继续重分布,针对表、库、实例 
continue rebalance table test.testtable;
continue rebalance database test;
continue rebalance instance ;
#取消重分布,针对表、库、实例
cancel rebalance table test.testtable;
cancel rebalance database test ;
cancel rebalance instance ;
5、删除旧distribution
#查看旧distributionid
gcadmin showdistribution vc vc1
#确定没有再用旧的id
select index_name,tbname,data_distribution_id,vc_id from gbase.table_distribution;
#删除旧ID (比如vc1中的1)
gcadmin rmdistribution 1 vc vc1
5、从集群中删除缩容节点
#修改为要剔除的节点ip
vim gcChangeInfo.xml
#删除节点
gcadmin rmnodes gcChangeInfo.xml vc1
6、卸载缩容节点
#从freenodes中移除
gcadmin rmnodes gcChangeInfo.xml
#修改demo.options 文件,注释掉没用的gcware,
#写入exists 要保留和coordinator datahost为当前卸载信息。
#停止服务后,卸载这个节点
cp demo.options demo.optionsbak
vim demo.options
gcluster_services all stop
gcware_services all stop
./unInstall.py --silent=demo.options
7、启动所有节点
gcluster_services all start
gcware_services all start

(二)、兼容模式
(A)、缩容data节点
1、复制gcChangeInfo.xml ,修改内容,去掉缩容节点
cp gcChangeInfo.xml bakgcChangeInfo.xml
vim gcChangeInfo.xml
2、生成distribution
gcadmin distribution gcChangeInfo.xml p 1 d 1
3、初始化 
initnodedatamap;
4、执行数据重分布
set global gcluster_rebalancing_concurrent_count=0 # 阻止 rebalance
rebalance instance  #将实例下表加入到 gclusterdb.rebalancing_status
set global gcluster_rebalancing_concurrent_count = 5 ;  # 设置重分布并发数
# select * from gclusterdb.rebalancing_status;  #查看进度
#暂停 重分布,针对表、库、实例
pause rebalance table test.testtable ;
pause rebalance database test;
pause rebalance instance;
#继续重分布,针对表、库、实例 
continue rebalance table test.testtable;
continue rebalance database test;
continue rebalance instance ;
#取消重分布,针对表、库、实例
cancel rebalance table test.testtable;
cancel rebalance database test ;
cancel rebalance instance ;
5、删除旧distribution
#查看旧distributionid
gcadmin showdistribution
#确定没有再用旧的id
select index_name,tbname,data_distribution_id,vc_id from gbase.table_distribution;
#删除旧ID (比如vc1中的1)
gcadmin rmdistribution 1
5、从集群中删除缩容节点
#修改为要剔除的节点ip
vim gcChangeInfo.xml
#删除节点
gcadmin rmnodes gcChangeInfo.xml
#修改demo.options 文件,注释掉没用的,gcware coordinator,停止服务后,卸载这个节点
cp demo.options demo.optionsbak
vim demo.options
gcluster_services all stop
./unInstall.py --silent=demo.options

(B)、缩容coordinator节点
1、修改demo.options 文件,注释掉没用的gcware datahost。
填写coordinator 和exists节点。
cp demo.options demo.optionsbak
vim demo.options
2、停止所有节点服务,卸载这个节点
gcluster_services all stop
gcware_services all stop
./unInstall.py --silent=demo.options
3、启动所有节点
gcluster_services all start
gcware_services all start

(C)、缩容复合节点
1、复制gcChangeInfo.xml ,修改内容,去掉缩容节点,留下要保留节点
cp gcChangeInfo.xml bakgcChangeInfo.xml
vim gcChangeInfo.xml
2、生成distribution
gcadmin distribution gcChangeInfo.xml p 1 d 1
3、初始化 
initnodedatamap;
4、执行数据重分布
set global gcluster_rebalancing_concurrent_count=0 # 阻止 rebalance
rebalance instance  #将实例下表加入到 gclusterdb.rebalancing_status
set global gcluster_rebalancing_concurrent_count = 5 ;  # 设置重分布并发数
# select * from gclusterdb.rebalancing_status;  #查看进度
#暂停 重分布,针对表、库、实例
pause rebalance table test.testtable ;
pause rebalance database test;
pause rebalance instance;
#继续重分布,针对表、库、实例 
continue rebalance table test.testtable;
continue rebalance database test;
continue rebalance instance ;
#取消重分布,针对表、库、实例
cancel rebalance table test.testtable;
cancel rebalance database test ;
cancel rebalance instance ;
5、删除旧distribution
#查看旧distributionid
gcadmin showdistribution
#确定没有再用旧的id
select index_name,tbname,data_distribution_id,vc_id from gbase.table_distribution;
#删除旧ID (比如vc1中的1)
gcadmin rmdistribution 1
5、从集群中删除缩容节点
#修改为要剔除的节点ip
vim gcChangeInfo.xml
#删除节点
gcadmin rmnodes gcChangeInfo.xml
6、卸载缩容节点
#修改demo.options 文件,注释掉没用的gcware,
#写入exists 要保留和coordinator datahost为当前卸载信息。
#停止服务后,卸载这个节点
cp demo.options demo.optionsbak
vim demo.options
gcluster_services all stop
gcware_services all stop
./unInstall.py --silent=demo.options
7、启动所有节点
gcluster_services all start
gcware_services all start

评论

登录后才可以发表评论
崔哥发表于 4个月前
暖气潜催次第春,梅花已谢杏花新。半开半落闲园里,何异荣枯世上人。