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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM