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

TDSQL PostgreSQL 版 (原 TBase)集群管理必会命令

原创 董小姐 2024-11-16
441

TDSQL PostgreSQL 版 (原 TBase)集群管理必会命令

启动集群

通过pgxc_ctl工具的start all命令来启动集群

进入pgxc_ctl工具

[tbase@tbase159 ~]$ pgxc_ctl
/bin/bash
Installing pgxc_ctl_bash script as /opt/data/tbase/pgxc_ctl/pgxc_ctl_bash.
Installing pgxc_ctl_bash script as /opt/data/tbase/pgxc_ctl/pgxc_ctl_bash.
Reading configuration using /opt/data/tbase/pgxc_ctl/pgxc_ctl_bash --home /opt/data/tbase/pgxc_ctl --configuration /opt/data/tbase/pgxc_ctl/pgxc_ctl.conf
Finished reading configuration.
   ******** PGXC_CTL START ***************

Current directory: /opt/data/tbase/pgxc_ctl
PGXC

启动集群

通过pgxc_ctl工具的start all命令来启动集群

[tbase@tbase159 ~]$ pgxc_ctl
/bin/bash
Installing pgxc_ctl_bash script as /opt/data/tbase/pgxc_ctl/pgxc_ctl_bash.
Installing pgxc_ctl_bash script as /opt/data/tbase/pgxc_ctl/pgxc_ctl_bash.
Reading configuration using /opt/data/tbase/pgxc_ctl/pgxc_ctl_bash --home /opt/data/tbase/pgxc_ctl --configuration /opt/data/tbase/pgxc_ctl/pgxc_ctl.conf
Finished reading configuration.
   ******** PGXC_CTL START ***************

Current directory: /opt/data/tbase/pgxc_ctl
PGXC start all   --注意是在PGXC 后面输入 start all然后回车

查看集群状态

进入pgxc_ctl工具

[tbase@tbase159 ~]$ pgxc_ctl
/bin/bash
Installing pgxc_ctl_bash script as /opt/data/tbase/pgxc_ctl/pgxc_ctl_bash.
Installing pgxc_ctl_bash script as /opt/data/tbase/pgxc_ctl/pgxc_ctl_bash.
Reading configuration using /opt/data/tbase/pgxc_ctl/pgxc_ctl_bash --home /opt/data/tbase/pgxc_ctl --configuration /opt/data/tbase/pgxc_ctl/pgxc_ctl.conf
Finished reading configuration.
   ******** PGXC_CTL START ***************

Current directory: /opt/data/tbase/pgxc_ctl
PGXC

查看集群状态

通过pgxc_ctl工具的monitor all命令来查看集群状态

[tbase@tbase159 ~]$ pgxc_ctl
/bin/bash
Installing pgxc_ctl_bash script as /opt/data/tbase/pgxc_ctl/pgxc_ctl_bash.
Installing pgxc_ctl_bash script as /opt/data/tbase/pgxc_ctl/pgxc_ctl_bash.
Reading configuration using /opt/data/tbase/pgxc_ctl/pgxc_ctl_bash --home /opt/data/tbase/pgxc_ctl --configuration /opt/data/tbase/pgxc_ctl/pgxc_ctl.conf
Finished reading configuration.
   ******** PGXC_CTL START ***************

Current directory: /opt/data/tbase/pgxc_ctl
PGXC
PGXC monitor all   -- 注意是在PGXC 后面输入 monitor all 然后回车
Running: gtm master
Not running: gtm slave
Running: coordinator master cn001
Running: coordinator master cn002
Running: datanode master dn001
Running: datanode slave dn001
Running: datanode master dn002
Running: datanode slave dn002

停止集群

通过pgxc_ctl工具的stop all命令来停止集群,stop all 后面可以加上参数 -m fast或者是-m immediate来决定如何停止各个节点。

pgxc_ctl stop all -m fast


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

评论