Obtaining the cluster LEADER node¶
It may be useful to know the PostgreSQL cluster LEADER node without having to consult the logs. To do this, the following command run as root meets this need:
1 | |
Example
The result obtained should have the following form:
1 2 3 4 5 6 7 | |
In addition to giving the LEADER, the command also shows in the last column the number of MB of delay compared to the LEADER.
If a node has just stopped, the stopped status will be indicated. Note that in the event of a cluster node failure, this information will only be displayed temporarily before the node is removed from the list.