repmgr学习记录(主从切换)

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

 

Automatic failover with repmgrd

posted @ 2017-08-24 16:28  pg_libs  阅读(2016)  评论(0编辑  收藏  举报