GBase 8a数据库集群在9.5版里,提供了启动,停止所有数据节点的功能。一般数据节点都很多,几十到上百个,该功能可以快速的停止指定VC或者默认所有数据节点的服务。当然对管理节点是不生效的。
gcadmin stopvc VCNAME dba_user dba_pwd
gcadmin startvc VCNAME dba_user dba_pwd
其中vcname 如果是自建了vc,那么用vcname, 如果是从86升级的,或者默认安装没有创建vc,那么默认的vc是 vcname000001
vcname支持一次启停多个,用逗号分割。
dba_user是数据库的操作系统用户
dba_user是数据库的操作系统用户密码
比如
gcadmin stopvc vcname000001 gbase gbase1234
[gbase@gbase_rh7_001 gcinstall]$ gcadmin startvc vc1 vc2 gbase gbase1234
gcadmin startvc ...
gcadmin startvc check vc exist
gcadmin startvc get vc node list
gcadmin start virtual cluster successful
[gbase@gbase_rh7_001 gcinstall]$
[gbase@gbase_rh7_001 gcinstall]$ gcadmin stopvc vc1 vc2 gbase gbase1234
gcadmin stopvc ...
gcadmin stopvc check vc exist
gcadmin stopvc get vc node list
gcadmin stop virtual cluster successful
[gbase@gbase_rh7_001 gcinstall]$ gcadmin showcluster vc vc1
CLUSTER STATE: ACTIVE
VIRTUAL CLUSTER MODE: NORMAL
=============================================
| GBASE VIRTUAL CLUSTER INFORMATION |
=============================================
| VcName | DistributionId | comment |
---------------------------------------------
| vc1 | 1,4 | vc_101 |
---------------------------------------------
=========================================================================================================
| VIRTUAL CLUSTER DATA NODE INFORMATION |
=========================================================================================================
| NodeName | IpAddress | DistributionId | gnode | syncserver | DataState |
---------------------------------------------------------------------------------------------------------
| node1 | 10.0.2.101 | 1,4 | CLOSE | CLOSE | 0 |
---------------------------------------------------------------------------------------------------------
| node2 | 10.0.2.102 | 1,4 | CLOSE | CLOSE | 0 |
---------------------------------------------------------------------------------------------------------
2 data node
[gbase@gbase_rh7_001 gcinstall]$ gcadmin showcluster vc vc2
CLUSTER STATE: ACTIVE
VIRTUAL CLUSTER MODE: NORMAL
=============================================
| GBASE VIRTUAL CLUSTER INFORMATION |
=============================================
| VcName | DistributionId | comment |
---------------------------------------------
| vc2 | 2,3 | vc_102 |
---------------------------------------------
=========================================================================================================
| VIRTUAL CLUSTER DATA NODE INFORMATION |
=========================================================================================================
| NodeName | IpAddress | DistributionId | gnode | syncserver | DataState |
---------------------------------------------------------------------------------------------------------
| node1 | 10.0.2.115 | 2,3 | CLOSE | CLOSE | 0 |
---------------------------------------------------------------------------------------------------------
1 data node
[gbase@gbase_rh7_001 gcinstall]$
备注:目前,没有一个命令停止所有管理节点的功能。