How it works...
Finally, an easy recipe! Our first (and really only) step is to stop PostgreSQL on the primary node. Our second step is to watch the aftermath. One quick call to systemctl to stop PostgreSQL, and we want to watch the other two nodes to see the state of the cluster change, and how it happens.
The first of these observations is on the standby node, which will presumably be promoted. We set the log location to /var/log/postgresql/repmgr.log in the Installing and configuring repmgr recipe. This allows us to watch the log as the repmgr daemon begins to perform the failover process.
The first thing that happens is that pgha2 loses contact with pgha1 and begins a series of checks to verify that this wasn't an errant reading. We can ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access