postgresql 高可用 repmgr 的使用之十 1 Primary + 2 Standby 的 auto failover 之后失败节点 rejoin
生活随笔
收集整理的這篇文章主要介紹了
postgresql 高可用 repmgr 的使用之十 1 Primary + 2 Standby 的 auto failover 之后失败节点 rejoin
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
os:ubunbu 16.04
postgresql:9.6.8
repmgr:4.1.1
192.168.56.101 node1
192.168.56.102 node2
192.168.56.103 node3
手動 rejoin
$ sudo pg_ctlcluster 9.6 main stop
$ repmgr -f /etc/repmgr.conf node rejoin -d 'host=192.168.56.103 user=repmgr dbname=repmgr connect_timeout=2' --force-rewind --dry-run --verbose
$ repmgr -f /etc/repmgr.conf node rejoin -d 'host=192.168.56.103 user=repmgr dbname=repmgr connect_timeout=2' --force-rewind --verbose
中間出錯或者搞不定的話,就重新做一次 standby clone。
數據庫大、網絡帶寬、IO不行的話,時間比較長。
$ cd /var/lib/postgresql/9.6/main
$ rm -rf ./*
$ repmgr -h 192.168.56.103 -U repmgr -d repmgr -f /etc/repmgr.conf standby clone --dry-run --verbose
$ repmgr -h 192.168.56.103 -U repmgr -d repmgr -f /etc/repmgr.conf standby clone --verbose
$ sudo pg_ctlcluster 9.6 main start
$ repmgr -f /etc/repmgr.conf standby register --upstream-node-id=3 --force --verbose
最后一步 standby register 時的 --upstream-node-id,設置為當前真實的master。
查看cluster
$ repmgr -f /etc/repmgr.conf cluster show
自動 rejoin
還不知道怎么自動rejoin,有路過哥們知道的話,指點下。
參考:
https://repmgr.org
https://repmgr.org/docs/4.1
總結
以上是生活随笔為你收集整理的postgresql 高可用 repmgr 的使用之十 1 Primary + 2 Standby 的 auto failover 之后失败节点 rejoin的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 中信正义联盟小白two卡网申容易过吗?就
- 下一篇: Proxmark3命令帮助