二重化主备切换过程中Postgresql的状态变化

发表于 2017-05-16   |   分类于 技术

在使用pacemaker部署的主备服务器环境中,由于使用到了postgresql,对其复杂的状态变化做了如下整理。

1.pgsql-status

■PRI : running as Primary(Master)
■HS : running as Hot Standby(Slave)
    HS:alone : running as Hot Standby,not connected to Primary
    HS:async : running as Hot Standby in Asynchronous replication mode
    HS:sync : running as Hot Standby in Synchronous replication mode
■STOP : stopped

2.pgsql-data-status

■DISCONNECT:
    Master changes other node state into DISCONNECT if Master can't detect connection of replication because of LAN failure or breakdown of Slave and so on.
■{state}|{sync_state}
    Master changes other node state into {state}|{sync_state} if Master detects connection of replication.
    {state} and {sync_state} means state of replication which is retrieved using "select state and sync_state from pg_stat_replication" on Master.
    For example, INIT, CATCHUP, and STREAMING are displayed in {state} and ASYNC, SYNC are displayed in {sync_state}
■LATEST:
    It's displayed when it's Master.

3.Pacemaker's status

■Master : manage PostgreSQL as Master
■Slave : manage PostgreSQL as Slave
■Stopped : manage PostgreSQL as Stopped     

4.status change

act_change_status.png

sby_change_status.png

发表新评论

© 2017 Powered by Typecho
苏ICP备15035969号-3