码迷,mamicode.com
首页 > 其他好文 > 详细

repmgr学习记录(主从切换)

时间:2017-08-24 16:42:02      阅读:299      评论:0      收藏:0      [点我收藏+]

标签:top   ast   switch   ima   home   log   images   code   stand   

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学习记录(主从切换)

标签:top   ast   switch   ima   home   log   images   code   stand   

原文地址:http://www.cnblogs.com/pg-libs/p/7423463.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!