pgsql method to view active and standby nodes

1. Through pg_controldata output, the main database is Database cluster state, Database cluster state is in production, and the standby database is in archive recovery.

$PGHOME/bin/pg_controldata -D /PGdata

2. Through the built-in function pg_is_in_recovery, it is true for the standby machine, and false for the main library

3. View through the process, show that wal sender or walwrite is the host, and show wal receiver is the standby machine

ps -ef | grep wal

Guess you like

Origin blog.51cto.com/2012ivan/2605435