Common maintenance tasks

Let's now take a look at some common maintenance tasks.

Performing maintenance on a single node

Pacemaker has a built-in notion of bringing a node down for maintenance. This is called standby mode. This mode is also used for enforced failover.

You can activate it like this:

pcs cluster standby db1

If this command is issued on the master, it causes Pacemaker to try to gracefully shut down PostgreSQL. If the shutdown takes more than 110 seconds, a forced kill of PostgreSQL is tried. If this fails, the node is rebooted. Then Pacemaker moves the master IP over to the other node and promotes the chosen PostgreSQL slave to the master role. It is recommended that you issue a CHECKPOINT command on the master prior to doing this step ...

Get PostgreSQL Replication - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.