pgpool 之六 pgpool 的一些命令
生活随笔
收集整理的這篇文章主要介紹了
pgpool 之六 pgpool 的一些命令
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
os: ubuntu 16.04
db: postgresql 9.6.8
pgpool: pgpool-II-3.7.7
pcp_recovery_node
執行在線恢復
$ pcp_recovery_node -v -d -h 192.168.56.100 -p 9898 -U postgres -n 1pcp_promote_node
從 pgpool 提升一個節點
$ /usr/pgpool-3.7.7/bin/pcp_promote_node -v -d -h 192.168.56.100 -p 9898 -U pgpool -n 1 Password:pcp_detach_node
從 pgpool 分離一個節點
$ /usr/pgpool-3.7.7/bin/pcp_detach_node -n 1 -U pgpool Password: pcp_detach_node -- Command Successfulpcp_attach_node
給 pgpool 關聯一個節點
$ /usr/pgpool-3.7.7/bin/pcp_attach_node -v -d -n 1 -U pgpool Password: pcp_attach_node -- Command Successful執行 pcp_attach_node 命令后,用 show pool_nodes 查看節點時會看到 status=waiting。此時需要退出所有的連接,再登錄時就是 up 了。
pcp_node_count
獲取 pgpool 節點數量
$ /usr/pgpool-3.7.7/bin/pcp_node_count -v -d -U pgpool Password:pcp_node_info
獲取 pgpool 節點信息
$ /usr/pgpool-3.7.7/bin/pcp_node_info -v -d -n 0 -U pgpool Password: 192.168.56.92 5432 1 0.500000 waiting primary$ /usr/pgpool-3.7.7/bin/pcp_node_info -v -d -n 1 -U pgpool Password: 192.168.56.90 5432 1 0.500000 waiting standbypcp_pool_status
獲取 pgpool 的連接池狀態
$ /usr/pgpool-3.7.7/bin/pcp_pool_status -v -d -U pgpool Password: name : listen_addresses value: * desc : host name(s) or IP address(es) to listen onname : heartbeat_destination_port0 value: 9694 desc : destination port for sending heartbeat using NIC device 0pcp_proc_count
獲取 pgpool 進程列表
$ /usr/pgpool-3.7.7/bin/pcp_proc_count -v -d -U pgpool Password: 8658 8659 8660 8661 8662 8663 8664 8665 8666 8667 8668 8669 8670 8671 8672 8673 8674 8675 8676 8677 8678 8679 8680 8681 8682 8683 8684 8685 8686 8687 8691 8692pcp_proc_info
獲取 pgpool 進程信息
$ /usr/pgpool-3.7.7/bin/pcp_proc_info -v -d -U pgpool Password: No process information availablepcp_stop_pgpool
停止 pgpool
$ /usr/pgpool-3.7.7/bin/pcp_stop_pgpool -v -d -U pgpool Password: pcp_stop_pgpool -- Command Successfulpcp_watchdog_info
查看 pgpool watchdog 信息
$ /usr/pgpool-3.7.7/bin/pcp_watchdog_info -v -d -U pgpool Password: 2 YES 192.168.56.92:9999 Linux xxoo 192.168.56.92192.168.56.92:9999 Linux xxoo 192.168.56.92 9999 9000 4 MASTER 192.168.56.90:9999 Linux xxoo 192.168.56.90 9999 9000 7 STANDBY參考:
http://www.pgpool.net/mediawiki/index.php/Downloads
http://www.pgpool.net/docs/latest/en/html/index.html
總結
以上是生活随笔為你收集整理的pgpool 之六 pgpool 的一些命令的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 快速排序算法原理详解
- 下一篇: jq判断复选框是否被选中的3中方法