1. 程式人生 > >repmgr學習記錄(主從切換)

repmgr學習記錄(主從切換)

over ges -h stand code nbsp 嘗試 strong 服務

1.服務器狀態:一主二備

技術分享

2.停主庫:pg_ctl -D /home/postgres/PG-9.6.1/ stop

  此時node2、node3仍均處於read-only狀態

3.將node2恢復為主庫:repmgr -f repmgr.conf standby promote

技術分享

  此時node3仍然嘗試連接node1

4.將node3指向新的master:

  repmgr -f repmgr.conf -D /home/postgres/PG-9.6.1/ -h 192.168.98.63 -U repmgr -d repmgr standby follow

主動的主從切換repmgr -f /etc/repmgr.conf -C /etc/repmgr.conf standby switchover -v

repmgr學習記錄(主從切換)