postgresql之流复制监控pg_stat_replication参数
pg_stat_replication参数详解
postgres=# select * from pg_stat_replication ; pid | usesysid | usename | application_name | client_addr | client_hostname | client_port | backend_start | backend_xmin | state | sent_lsn | write_lsn | flush_lsn | replay _lsn | write_lag | flush_lag | replay_lag | sync_priority | sync_state ------+----------+---------+------------------+---------------+-----------------+-------------+-------------------------------+--------------+-----------+------------+------------+------------+------- -----+-----------+-----------+------------+---------------+------------ 4364 | 16384 | repuser | node2 | 192.168.12.11 | | 46342 | 2021-11-01 22:20:10.003338-04 | | streaming | 0/4F508D70 | 0/4F508D70 | 0/4F508D70 | 0/4F50 8D70 | | | | 1 | sync (1 row)
sent_lsn:wal发送进程最近发送的位置
write_lsn:备库最近写入的wal日志位置
flush_lsn:主库落盘后等待备库接受的wal日志,wal日志流已写入备库,但还没有应用wal日志,并返回确认信息
replay_lsn:主库已落盘,备库已应用wal日志并返回确认信息
write_lag:主库已落盘,等待备库落盘,且wal日志流还在操作系统缓存中
sync_priority:优先级备库
sync_state:同步状态

浙公网安备 33010602011771号