The last thing we are going to add should be considered a requirement when building a high-availability PostgreSQL cluster. Any time the status of Pacemaker changes; we can have it transmit an e-mail alerting us to the activity. Not only is this possible with Pacemaker, it's relatively easy to set up.
This recipe will outline the steps necessary to add an e-mail alert to Pacemaker.
As we're continuing to configure Pacemaker, make sure you've followed all the previous recipes.
Perform these steps on any Pacemaker node as the root
user:
- Add an e-mail
primitive
to Pacemaker withcrm
:
crm configure primitive pg_mail ocf:heartbeat:MailTo \ params email="[email protected]" \ subject="Pacemaker\ cluster\ status\ changed:\ "
- Clean up any errors that might have accumulated with
crm
:
crm resource cleanup pg_mail
- Display the status of our new e-mail alert with
crm
:
crm resource status