首页 > 数据库 > > 数据库系统管理-启停集群
在进行集群维护、故障排查和修复时,可以根据需要对集群进行启停。
gs_om -t start
gs_om -t start -h plat1
gs_om -t start -h plat1 -I DB1_1启动一组DN。假设group_1为指定启动的DN组的名称。
gs_om -t start -g group_1停止集群
gs_om -t stop停止单个主机上的所有实例。假设plat1为主机的名称。
gs_om -t stop -h plat1停止单个主机上的指定实例,可停止的实例类型有CM、CN、DN、GTS,不支持启动ETCD。假设plat1为指定实例所在主机的名称,DB1_1为指定停止的实例的名称。
gs_om -t stop -h plat1 -I DB1_1停止一组DN。假设group_1为指定停止的DN组的名称。
gs_om -t stop -g group_1如果数据库集群使用Zenith_Zpaxos内核,启停集群或节点时,应确保同组在线DN个数大于非在线DN个数,否则DN状态会不正常。
在集群断电需要启动ETCD的情况下,GaussDB 100提供手动拉起ETCD的工具gs_om。只有在$CM_HOME下dumpfile.json文件存在并且未损坏的情况下,才能使用gs_om -t startetcd命令手动拉起ETCD。
gs_om -t startetcd

在需要彻底停止集群的情况下,GaussDB 100提供手动停止ETCD的工具gs_om。只有在$CM_HOME下dumpfile.json文件存在并且未损坏的情况下,才能使用gs_om -t stopetcd命令手动停止ETCD。停止ETCD前需要先使用命令“gs_om -t stop”停止集群。
gs_om -t stopetcd
omm@plat1:~> gs_om -t start
Starting cluster
=========================================
cluster_state : Normal
Successfully started cluster.
=========================================
End started cluster.
omm@plat1:~> gs_om -t start -h plat1
Starting node.
=========================================
Successfully started node.
=========================================
End started node.
omm@plat1:~> gs_om -t start -h plat1 -I DB1_1
Starting instance
=========================================
Successfully started instance.
=========================================
End started instance.
示例4:停止集群。
omm@plat1:~> gs_om -t stop
Stopping cluster.
=========================================
Successfully stopped cluster.
=========================================
End stop cluster.
示例5:停止集群中单个主机。
omm@plat1:~> gs_om -t stop -h plat1
Stopping node.
=========================================
Successfully stopped node.
=========================================
End stop node.
示例6:停止集群中指定实例。
omm@plat1:~> gs_om -t stop -h plat1 -I DB1_1
Stopping instance.
=========================================
Successfully stopped instance.
=========================================
End stop instance.
示例7:手动拉起ETCD
omm@plat1:~> gs_om -t startetcd
Restarting etcd in the cluster.
Clean old cm and etcd for cluster.
Successfully clean old cm and etcd for cluster.
Restart etcd for cluster.
Restart cmAgent for cluster.
Successfully restarting etcds in the cluster.
示例8:手动停止ETCD
omm@plat1:~> gs_om -t stopetcd
Stop etcd is a high-risk operation. Are you sure you want to continue (yes/no)?yes
Checking the cluster condition for stopping etcd.
Checking the inst process on every node for stoppig etcd.
Successfully checked the inst process on every node for stopping etcd.
Successfully checked the cluster condition for stopping etcd.
Stopping etcd in the cluster.
Clean old cm and etcd for cluster.
Successfully clean old cm and etcd for cluster.
Successfully stopped etcd in the cluster.
如果启动集群或者停止集群服务失败,请根据日志文件中的日志信息排查错误,参见管理日志。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69959250/viewspace-3129597/ ,如需转载,请注明出处,否则将追究法律责任。