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

MogDB 实例启停

原创 王艳东 2021-12-10
392

一、集群环境使用 gs_om 工具进行启停

主节点实例状态

[omm@node1 mogdb]$ ps -ef|grep mog|grep -v grep

omm 109049 1 4 10:25 pts/1 00:00:22 /data/mogdb/app/bin/mogdb -D /data/mogdb/data/db1 -M primary

备节点实例状态

[omm@node2 ~]$ ps -ef|grep mog|grep -v grep

omm 14266 1 12 10:25 ? 00:01:12 /data/mogdb/app/bin/mogdb -D /data/mogdb/data/db1 -M standby

1、启动实例

[omm@node1 mogdb]$ gs_om -t start

Starting cluster.

=========================================

[SUCCESS] node1

2021-12-09 10:24:12.408 [unknown] [unknown] localhost 140284866000640 0 0 [BACKEND] WARNING: Failed to initialize the memory protect for g_instance.attr.attr_storage.cstore_buffers (16 Mbytes) or shared memory (4700 Mbytes) is larger.

[SUCCESS] node2

2021-12-09 10:24:19.875 [unknown] [unknown] localhost 140537012578048 0 0 [BACKEND] WARNING: Failed to initialize the memory protect for g_instance.attr.attr_storage.cstore_buffers (16 Mbytes) or shared memory (4700 Mbytes) is larger.

=========================================

Successfully started.

2、关闭实例

[omm@node1 mogdb]$ gs_om -t stop

Stopping cluster.

=========================================

Successfully stopped cluster.

=========================================

End stop cluster.

3、重启实例

[omm@node1 mogdb]$ gs_om -t restart

Stopping cluster.

=========================================

Successfully stopped cluster.

=========================================

End stop cluster.

Starting cluster.

=========================================

[SUCCESS] node1

2021-12-09 10:25:38.659 [unknown] [unknown] localhost 140624450180864 0 0 [BACKEND] WARNING: Failed to initialize the memory protect for g_instance.attr.attr_storage.cstore_buffers (16 Mbytes) or shared memory (4700 Mbytes) is larger.

[SUCCESS] node2

2021-12-09 10:25:42.711 [unknown] [unknown] localhost 140716486657792 0 0 [BACKEND] WARNING: Failed to initialize the memory protect for g_instance.attr.attr_storage.cstore_buffers (16 Mbytes) or shared memory (4700 Mbytes) is larger.

=========================================

Successfully started.

4、查看实例状态

[omm@node1 mogdb]$ gs_om -t status

-----------------------------------------------------------------------

cluster_name : dbCluster

cluster_state : Normal

redistributing : No

-----------------------------------------------------------------------

[omm@node1 mogdb]$ gs_om -t status --detail

[ Cluster State ]

cluster_state : Normal

redistributing : No

current_az : AZ_ALL

[ Datanode State ]

node node_ip instance state | node node_ip instance state

----------------------------------------------------------------------------------------------------------------------------------------------------

1 node1 192.168.10.52 6001 /data/mogdb/data/db1 P Primary Normal | 2 node2 192.168.10.53 6002 /data/mogdb/data/db1 S Standby Normal

5、如果是超时导致启动失败,可以执行如下命令,设置启动超时时间,默认超时时间为300s。

[omm@node1 mogdb]$ gs_om -t start --time-out=300

说明: 双机启动必须以双机模式启动, 若中间过程以单机模式启动, 则必须修复才能恢复双机关系, 用gs_ctl build进行修复,gs_ctl的使用方法参见“参考指南 > 工具参考 > 系统内部使用的工具 > gs_ctl”章节

二、单机环境用 gs_ctl 工具进行启停

gs_ctl start|stop|restart -D $GAUSSHOME/data/single_node

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

评论