pgsql查看主备节点的方法
时间:2021-01-25 14:21:20
收藏:0
阅读:154
1、通过pg_controldata输出,主库Database cluster state,Database cluster state为 in production, 备库为in archive recovery。
$PGHOME/bin/pg_controldata -D /PGdata
2、通过自带的函数pg_is_in_recovery,是备机则是true,主库是false
3、通过进程查看,显示wal sender或者walwrite的是主机,显示wal receiver的是备机
ps -ef|grep wal
原文:https://blog.51cto.com/2012ivan/2605435
评论(0)