pgsql查看主備節點的方法

一、經過pg_controldata輸出,主庫Database cluster state,Database cluster state爲 in production, 備庫爲in archive recovery。ide

$PGHOME/bin/pg_controldata -D /PGdata函數

二、經過自帶的函數pg_is_in_recovery,是備機則是true,主庫是false進程

三、經過進程查看,顯示wal sender或者walwrite的是主機,顯示wal receiver的是備機it

ps -ef|grep walio

相關文章
相關標籤/搜索