Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
VGSources
Blog

How to Build a High-Availability Setup with Corosync and Pacemaker

A practical, safety-first guide to building Corosync and Pacemaker HA clusters, including two-node quorum, fencing, virtual IPs, service resources, constraints and recovery tests.
Length10 min Posted Quest giverVGSources Team

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A reliable Corosync–Pacemaker cluster is built in a strict order: establish authenticated node communication, create a healthy cluster, configure quorum and tested STONITH fencing, then add application resources with explicit ordering and colocation constraints. Pacemaker can restart or move services, but it cannot make an application’s data safe by itself; stateful workloads still need shared storage or a separate replication design.

What Corosync and Pacemaker each do

These projects solve different parts of high availability and are normally deployed together.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Corosync: membership, messaging and quorum

Corosync provides the communication layer between nodes, tracks which members are present, and calculates quorum from the configured votes. Its transport and authentication settings determine whether nodes can exchange cluster traffic safely. If a network partition creates separate groups, Corosync supplies the membership and quorum information Pacemaker uses to decide whether either group may continue.

Pacemaker: resource placement and recovery

Pacemaker is the high-availability resource manager. It evaluates node and resource health, chooses where resources should run, and starts, stops or relocates them after failures. Resource agents implement service-specific operations such as start, stop and monitor. Constraints express dependencies: ordering controls sequence, colocation keeps related resources together, and location rules prefer or prohibit particular nodes.

#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter | 4Pack Type C Female to A Male Cable Converter for Apple Duo 17 16 15 14 Plus,iWatch Watch 12 11 10,iPad 9 8 Air,Airpods 5 4
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Fencing: isolating a node that may still be running

STONITH (Shoot The Other Node In The Head) prevents a failed or partitioned node from continuing to access data while another node takes over. A fence agent connects to an independent mechanism such as a BMC/IPMI controller, switched PDU, cloud fencing API or another platform-specific service. Fencing is not an optional enhancement for production failover; it is the proof that a node has been isolated.

Choose the topology before installing anything

Start with the failure you need to survive and the data guarantees the application requires. Pacemaker does not replicate databases, files or application state. Shared storage or application-level replication must be designed separately.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Design Typical placement Quorum and failure implications Data requirement
Two-node active/passive One node serves; the other waits Losing one node also loses a majority, so arbitration, fencing and a deliberate quorum policy are essential Shared storage or correctly designed application replication
N+1 Several active nodes with at least one spare capacity node More votes make quorum easier to maintain, but every node still needs reliable fencing Depends on whether services are stateless, replicated or storage-backed
Active/active service placement Different resources run on different nodes Requires accurate resource limits and constraints so a surviving node is not overloaded Each service’s own consistency and replication model
Cluster with external arbitration Two service nodes plus a qdevice or other independent vote An external vote can preserve a single partition’s majority after one service node fails Still requires a separate shared-storage or replication plan

For a two-node design, plan the arbitration mechanism at the same time as the nodes. ClusterLabs’ SBD guidance notes that watchdog-based self-fencing can work without shared storage, but a two-node watchdog arrangement needs external quorum such as Corosync qdevice with a third node. Do not assume that adding a second server automatically creates a safe failover cluster.

Prepare every node

Operating system and packages

Use a supported distribution release and keep the cluster packages on compatible versions. Install the core daemons plus the agents that make your intended resources and fencing device manageable. Package names and service commands vary by distribution.

  • Fedora example: dnf install -y corosync pacemaker pcs
  • RHEL-compatible example: yum install -y corosync pacemaker pcs
  • openSUSE example: zypper install corosync pacemaker
  • Debian-compatible example: apt-get install pacemaker corosync

Install resource-agents and fence-agents (or the distribution’s equivalent packages) as well. Without them, the daemons may start but you may have no supported agent for the web server, virtual IP, database, storage or fencing controller you intend to manage.

Identity, time and network prerequisites

  • Give every node a stable hostname and address. Ensure forward and reverse name resolution, or use consistent host-file entries if that is your operational standard.
  • Synchronize clocks across nodes. Consistent time makes logs, fencing decisions and incident reconstruction far easier.
  • Provide a reliable path for Corosync traffic and a separate management path where possible. Open the cluster-management and Corosync traffic required by your distribution and chosen transport.
  • Use Corosync authentication and encryption options supported by your distribution. The pcs reference documents knet, UDP/UDPU transports, quorum options, startup behavior and authentication-key synchronization.
  • Verify that each node can reach the management interface of every device it may fence. A fence path that shares the same failed switch or power domain as the cluster network is not independent protection.

Create the cluster with pcs

The following sequence is representative; exact prompts and options differ by distribution. Substitute your real hostnames and cluster name.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
  1. Install and enable the pcs service on every node. Set the distribution’s hacluster (or equivalent cluster-management) account password consistently where required.
  2. From the administration node, authenticate the intended members: pcs host auth node1 node2. Supply the cluster-management credentials when prompted.
  3. Create the cluster: pcs cluster setup mycluster node1 node2. Use the transport and address options documented for your distribution if the defaults do not match your network.
  4. Enable and start the cluster services on all members: pcs cluster enable --all followed by pcs cluster start --all.
  5. Wait for membership to settle, then inspect it with pcs status. Confirm that every intended node is online, quorum is reported as expected and no resource has been created yet.

Do not add production services while membership is incomplete or quorum is unhealthy. Fix naming, authentication, firewall and transport problems first; otherwise later resource failures will be difficult to distinguish from a broken cluster foundation.

Configure quorum and fencing before application resources

Quorum policy

Quorum normally requires more than half of the configured votes. For example, four of six votes is a majority; three of six is not. By default, Pacemaker stops all resources if the cluster loses quorum. That behavior protects data when a partition cannot prove that it is the only surviving partition.

Change quorum behavior only after documenting the failure mode you are accepting. A setting that allows resources to continue without quorum may be appropriate for a narrowly defined, stateless edge case, but it can let two isolated partitions write at the same time. For stateful services, preserving consistency is usually more important than keeping a partially connected service online.

Install and verify STONITH

Choose a fence agent that matches the actual platform, then create one or more fencing resources according to that agent’s documentation. A generic IPMI-style example looks like this, but parameter names, credentials and security options are agent-specific:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
pcs stonith create fence-node1 fence_ipmilan ipaddr=192.0.2.21 pcmk_host_list=node1

Never copy a sample address or leave credentials in a command history. Restrict the fencing account to the required power operations, protect secrets, and configure coverage for every node that Pacemaker might need to isolate. If one device controls several nodes, verify that a failure of the device itself is accounted for in your design.

Test fencing from a maintenance window. The expected result is that the target node is actually powered off or isolated and that the surviving node records a successful fence operation. A resource that starts after a failed test is not evidence of safe fencing; it may simply mean the cluster never attempted isolation.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter | 85W Max PD, 2 USB 3.0 & 1 USBC Data Ports, SD/TF Card Reader, for Laptops/Mac and Other Type C Devices (Charger Not Included)
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Add a virtual IP and service resource

Use a distribution-provided or OCF resource agent rather than placing an unmanaged systemd service under Pacemaker. First identify the agent and inspect its supported parameters, for example with the agent’s metadata command or your distribution’s resource-agent documentation.

Create the virtual IP

This representative command creates a movable IPv4 address. Replace the address, netmask and monitor interval for your network:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
pcs resource create ClusterIP ocf:heartbeat:IPaddr2 ip=192.0.2.50 cidr_netmask=24 op monitor interval=30s

Create the application resource

Use the agent appropriate to the service. An Apache-style example is illustrative only; a database, game backend or custom daemon will require different parameters and health checks:

pcs resource create WebSite ocf:heartbeat:apache configfile=/etc/httpd/conf/httpd.conf statusurl=http://localhost/server-status op monitor interval=30s

The monitor operation must test meaningful service health, not merely whether a process exists. Validate that the agent’s start and stop actions are idempotent and that a failed monitor causes the recovery behavior you expect.

Encode startup and placement dependencies

Make the virtual IP available before the service starts and keep both resources on the same node:

pcs constraint order ClusterIP then WebSite
pcs constraint colocation add WebSite with ClusterIP INFINITY

Use location rules when a service should prefer a particular node, avoid a maintenance node or remain within capacity limits. Inspect the resulting model with pcs constraint and pcs status; a syntactically accepted constraint can still express the wrong dependency if the resource names or direction are reversed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Design data handling separately from failover

Pacemaker moves resource control; it does not copy application data. Before enabling automatic recovery, answer these questions:

  • Is the data on shared storage that both nodes can access safely after fencing?
  • If storage is local, does the application replicate synchronously or asynchronously, and how is the promoted copy selected?
  • What happens to in-flight writes during a node failure?
  • Can the service start on a second node without replaying or corrupting an old lock?
  • Which recovery point and recovery time objectives are acceptable?

For a stateless service, a virtual IP and service resource may be sufficient. For a stateful service, add the application’s replication or storage resources and encode their ordering and colocation rules. Do not treat a green pcs status display as proof that data consistency is solved.

Validate the cluster before trusting it

Baseline checks

  • pcs status: verify quorum, node membership, resource state and failed actions.
  • Quorum and membership views: confirm the expected vote count and that no node is unexpectedly partitioned.
  • Fencing history: verify recent operations, target identity and success result.
  • Constraint listings: confirm ordering, colocation and location rules match the service design.
  • Resource-agent monitor operations: check that health checks report failure when the service is deliberately stopped or made unreachable.

Controlled failover rehearsal

  1. Announce a maintenance window and record the intended owner, standby owner, client endpoint and rollback plan.
  2. Confirm that all resources are healthy and that fencing is operational before injecting a failure.
  3. Stop the managed service using a controlled method. Confirm that Pacemaker detects the monitor failure and restarts or relocates it according to policy.
  4. Restore the service and verify that the virtual IP, service endpoint and application data are correct.
  5. Test a node failure only when the fence path is ready. Observe whether the failed node is fenced before resources start elsewhere.
  6. After recovery, inspect failed actions, fencing history, logs and application-level consistency. Clear a stale failure record only after understanding its cause.

There is no universal failover-time number: detection intervals, fencing hardware, storage, application startup and network convergence differ by environment. Measure your own complete sequence from failure detection through verified service readiness.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Two-node clusters: the decisions that matter most

In a two-node cluster, one lost node removes the majority. A surviving node may therefore lose quorum even though it is healthy. Decide explicitly whether a third vote, qdevice, external arbitration service or another supported mechanism will determine which partition may continue.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Watchdog-based SBD can provide self-fencing without shared storage, but the two-node arrangement still needs external quorum such as Corosync qdevice with a third node. Do not disable fencing or force quorum merely to make the remaining node start resources. If the failed node still has access to shared storage, both nodes can write concurrently and corrupt data.

Common failure symptoms and corrective actions

Nodes do not appear online

Check hostname resolution, synchronized clocks, firewall rules, Corosync transport selection and authentication keys. Confirm that the cluster services are running on every intended member and that the addresses used by the configuration are reachable on the correct interface.

Best Value
Sale
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display | 85W Max PD, 1 Powered USB-C 5Gbps & 2 Powered USB-A 3.0 5Gbps Data Ports, for MacBook Pro, MacBook Air, Dell and More (Black)
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Resources remain stopped after a partition

Inspect quorum and fencing state first. Pacemaker stopping resources after quorum loss is the default safety behavior, not necessarily a resource-agent defect. Restore a healthy majority or complete the planned arbitration and fencing configuration before changing policy.

Pacemaker reports a monitor failure

Run the agent’s monitor operation manually where supported, inspect the service log and verify permissions, paths, ports and status URLs. A process can be running while the application is unusable; improve the monitor rather than masking the failure.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Fencing fails or times out

Test the fence device independently, verify credentials and address parameters, and ensure the target node is listed correctly. Check whether the management network or power controller is itself a single point of failure. Do not proceed to automatic failover until fencing succeeds reliably.

The service starts on the wrong node

Review location rules, resource stickiness, node attributes, colocation and ordering constraints. Inspect the scheduler’s reasons in pcs status and remove contradictory rules rather than repeatedly forcing a manual move.

Operational checklist

  • Supported operating-system and cluster-package versions are documented for every node.
  • Hostnames, addresses, time synchronization and Corosync transport are stable.
  • Authentication keys and management access are protected.
  • Resource agents and fence agents are installed and their parameters are documented.
  • Every node has a tested fencing path independent enough for the failure it must handle.
  • Quorum behavior, especially for two-node deployments, is written down and rehearsed.
  • Application data replication or shared storage has its own consistency and recovery runbook.
  • Ordering, colocation and location constraints have been reviewed against the real dependency graph.
  • Maintenance, node-failure and service-failure tests have been performed and logged.
  • Operators know how to inspect status, failed actions, constraints and fencing history before making changes.

What a safe result looks like

A finished setup is not merely two servers showing as online. It is a cluster in which Corosync can establish trustworthy membership and quorum, Pacemaker can place resources according to explicit dependencies, fencing can isolate every node when required, and the application’s own data model remains consistent during failover. Build and test those properties in that order, and only then allow automatic recovery to carry production traffic.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.