暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

华为GaussDB T 启停集群

墨天轮 2019-09-23
841

启停集群

在进行集群维护、故障排查和修复时,可以根据需要对集群进行启停。

启动集群

  • omm用户身份登录GaussDB 100所在的任意服务器。
  • 根据需要启动集群或实例。

    • 启动集群。
      gs_om -t start
    • 启动单个主机上的所有实例。假设plat1为主机的名称。
      gs_om -t start -h plat1
    • 启动单个主机上的指定实例,可启动的实例类型有CM、CN、DN、GTS,不支持启动ETCD。假设plat1为指定实例所在主机的名称,DB1_1为指定启动的实例的名称。
      gs_om -t start -h plat1 -I DB1_1
    • 启动一组DN。假设group_1为指定启动的DN组的名称。
      gs_om -t start -g group_1

停止集群

  • omm用户身份登录GaussDB 100所在的任意服务器。
  • 根据需要停止集群或实例。

    • 停止集群。
      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

在集群断电需要启动ETCD的情况下,GaussDB 100提供手动拉起ETCD的工具gs_om。只有在$CM_HOME下dumpfile.json文件存在并且未损坏的情况下,才能使用gs_om -t startetcd命令手动拉起ETCD。

  • omm用户身份登录GaussDB 100所在的任意服务器。
  • 手动拉起ETCD。

    gs_om -t startetcd

说明:

使用“gs_om -t startetcd”命令拉起ETCD后,集群中的CM server仍处于STOPPED状态,此时需要使用“gs_om -t start”命令手动重启集群才可恢复CM server到正常状态。

手动停止ETCD

在需要彻底停止集群的情况下,GaussDB 100提供手动停止ETCD的工具gs_om。只有在$CM_HOME下dumpfile.json文件存在并且未损坏的情况下,才能使用gs_om -t stopetcd命令手动停止ETCD。停止ETCD前需要先使用命令“gs_om -t stop”停止集群。

  • omm用户身份登录GaussDB 100所在的任意服务器。
  • 手动停止ETCD。

    gs_om -t stopetcd

示例

示例1:启动集群。
omm@plat1:~> gs_om -t start Starting cluster ========================================= cluster_state : Normal Successfully started cluster. ========================================= End started cluster.
示例2:启动集群中单个主机。
omm@plat1:~> gs_om -t start -h plat1 Starting node. ========================================= Successfully started node. ========================================= End started node.
示例3:启动集群中指定实例。
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.

错误排查

如果启动集群或者停止集群服务失败,请根据日志文件中的日志信息排查错误,参见管理日志。

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论