What is the supported Postgres database resource agent in a Pacemaker cluster?
Environment
- Red Hat Enterprise Linux 7, 8, 9 (with the High Availability Add-on)
- Pacemaker
Issue
- How do I manage a Postgres database as a cluster resource?
- Is the
ocf:heartbeat:pgsqlmsresource agent supported? - Can I implement Content from github.com is not included.PostgreSQL Automatic Failover (PAF) in a Pacemaker cluster?
- I want to use to manage my highly available Postgres database, but I can't find a Red Hat package for it.
Resolution
pgsql
The ocf:heartbeat:pgsql resource agent is shipped and supported by Red Hat via the resource-agents package. The supported version are listed at: Support Policies for RHEL High Availability Clusters - Management of a PostgreSQL Database in a Cluster.
NOTE: The resource-agent pgsql does not allow for automatic recovery of the postgresql resource when the resource is stopped or demoted when the node is master or promoted for the resource-agent. When the pgsql resource-agent is stopped or demoted then manually intervention will always be required for the resource to start again on that cluster node.
If you want to have automatic recovery (when the resource is stopped or demoted successfully) of a postgresql resource that is configured as master/slave or promotable resource-agent then use the resource-agent pgsqlms that is provided by the package resource-agents-paf on RHEL 8.5 or later. For more information about this then see: The pgsql resource fails to start with error My data may be inconsistent. You have to remove <path>/PGSQL.lock file to force start in a RHEL High Availability cluster with Pacemaker.
pgsqlms
The resource-agent pgsqlms was added to RHEL 8.5 (bz1872754) with errata RHSA-2021:4139 with the following package(s): resource-agents-4.1.1-98.el8, resource-agents-paf-4.1.1-98.el8, resource-agents-aliyun-4.1.1-98.el8, resource-agents-gcp-4.1.1-98.el8 or later. The resource-agent pgsqlms is part of the package: resource-agents-paf.
The resource-agent pgsqlms is provided by a 3rd party that Red Hat ships with the package resource-agents-paf.
Related Articles
For more information about postgresql and `pacemaker` see:
- Support Policies for RHEL High Availability Clusters - General Policies for Cluster Managed Resources and Applications
- Support Policies for RHEL High Availability Clusters - Management of a PostgreSQL Database in a Cluster
- The
pgsqlresource fails to start with errorMy data may be inconsistent. You have to remove <path>/PGSQL.lock file to force startin a RHEL High Availability cluster with Pacemaker - For more information about the resource-agent
pgsqlmsthen see: Content from clusterlabs.github.io is not included.PostgreSQL Automatic Failover (PAF).
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.