Nothing ruins high availability faster than a floating IP on one node while the service starts on another. A Pacemaker resource group keeps related resources together so they start, stop, and fail over as a single unit. Grouping dependent components reduces surprise downtime and makes failover behavior predictable.
In Pacemaker, each managed component is defined as a resource backed by an agent such as OCF (for example IPaddr2) or systemd (for example nginx). A resource group is an ordered list of resources where members start in the listed order and stop in reverse order. Group members are also colocated by design, so the group runs on one node as a set unless additional constraints change placement rules.
Only existing resources can be added to a group, so primitives must be created and verified before grouping. Creating or reordering a group in a live cluster can trigger stop/start operations to enforce ordering, which can briefly interrupt service or cause a relocation when constraints are recalculated. Plan the change for a maintenance window on production clusters.
Steps to create a Pacemaker resource group:
- Confirm the member resources exist before grouping.
$ sudo pcs status resources * cluster_ip (ocf:heartbeat:IPaddr2): Started node-02 * web-service (systemd:nginx): Started node-02
Related: How to create a Pacemaker resource
- Create the resource group with members listed in the desired start order.
$ sudo pcs resource group add web-stack cluster_ip web-service --wait=120 Waiting for the cluster to apply configuration changes (timeout: 120 seconds)... resource 'web-stack' is running on node 'node-02'
Pacemaker starts group members top-to-bottom and stops them bottom-to-top.
Group creation or membership changes can restart resources to enforce ordering, causing brief downtime.
- Display the group membership order.
$ sudo pcs resource group list web-stack: cluster_ip web-service
Additional members can be appended with pcs resource group add using the existing group name.
- Verify the group is started with all members on the same node.
$ sudo pcs status resources * Resource Group: web-stack: * cluster_ip (ocf:heartbeat:IPaddr2): Started node-02 * web-service (systemd:nginx): Started node-02
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
