PostGreSQL XL集群控制台命令大全

pgxc_ctl commands

创建

add gtm master name host port dir
add gtm slave name host port dir
add gtm_proxy name host port dir
add coordinator master name host port pooler dir extraServerConf extraPgHbaConf
add coordinator slave name host port pooler dir archDir
add datanode master name host port pooler dir xlogdir extraServerConf extraPgHbaConf
add datanode slave name host port pooler dir xlogdir archDir

初始化

init [force] all
init [force] nodename ...
init [force] gtm [ master | slave | all ]
init [force] gtm_proxy [ all | nodename ... ]
init [force] coordinator nodename ...
init [force] coordinator [ master | slave ] [ all | nodename ... ]
init [force] datanode nodename ...
init [force] datanode [ master | slave ] [ all | nodename ... ]

初始化过程中,每个组件的工作目录如果不存在,将会被创建。如果指定[force],将会工作目录下的所有内容将会被移除。不使用[force],则不会清除已经存在目录下的内容。

kill

kill all
kill nodename ...
kill gtm [ master | slave | all ]
kill gtm_proxy [ all | nodename ... ]
kill coordinator nodename ...
kill coordinator [ master | slave ] [ all | nodename ... ]
kill datanode nodename ...
kill datanode [ master | slave ] [ all | nodename ... ]

如果被指定kill的节点有master和slave,则两个节点将会被关闭。

日志

log [ variable | var ] *varname*

log [ message | msg ] *message_body*

Prints the specified contents to the log file. Variable or var option writes specified variable name and its value. Message or msg option writes specified message.

monitor all
monitor nodename ...
monitor gtm [ master | slave | all ]
monitor gtm_proxy [ all | nodename ... ]
monitor coordinator nodename ...
monitor coordinator [ master | slave ] [ all | nodename ... ]
monitor datanode nodename ...
monitor datanode [ master | slave ] [ all | nodename ... ]

监控指定节点是否行动

reconnect gtm_proxy [ all | nodename ... ]

当failover到slave GTM之后,需要执行重新连接指定的节点的操作。

删除节点

remove gtm master [ clean ]
remove gtm slave [ clean ]
remove gtm_proxy nodename [ clean ]
remove coordinator [ master| slave ] nodename [ clean ]
remove datanode [ master| slave ] nodename [ clean ]

开始节点

start all
start nodename ...
start gtm [ master | slave | all ]
start gtm_proxy [ all | nodename ... ]
start coordinator nodename ...
start coordinator [ master | slave ] [ all | nodename ... ]
start datanode nodename ...
start datanode [ master | slave ] [ all | nodename ... ]

暂停节点

stop [ -m smart | fast | immediate ] all
stop gtm [ master | slave | all ]
stop gtm_proxy [ all | nodename ... ]
stop [ -m smart | fast | immediate ] coordinator nodename ... 
stop [ -m smart | fast | immediate ] coordinator [ master | slave ] [ all | nodename ... ] 
stop [ -m smart | fast | immediate ] datanode nodename ... 
stop [ -m smart | fast | immediate ] datanode [ master | slave ] [ all | nodename ... ]

取消GTM中的注册节点

当节点崩溃启动新节点时,可能需要注销在GTM中注册的节点。

unregister unregister_option ...
# unregister_option有以下参数:
-n name: #指定需要注册的节点
-Z { gtm | gtm_proxy | gtm_proxy_postmaster | coordinator | datanode }  # 指定节点类别

以下文章点击率最高

Loading…

     

如果这文章对你有帮助,请扫左上角微信支付-支付宝,给于打赏,以助博客运营

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注