October 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 NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk11 min

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

Build a dependable Corosync and Pacemaker cluster by configuring membership and quorum first, fencing before services, then resources, constraints, and controlled failover tests—including the special requirements of two-node designs.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A reliable Corosync and Pacemaker cluster is built in layers: Corosync provides authenticated node communication, membership, and quorum; Pacemaker decides where services run and moves them after failures; resource agents control applications; and fence agents isolate nodes that may still be writing. Install and validate those layers in that order. In a two-node design, add independent arbitration or a third vote before you trust automatic failover.

The sequence below covers planning, package installation, pcs configuration, fencing, quorum, virtual IP and service resources, dependency constraints, and controlled failure testing. Package names and command options vary by distribution, so treat command examples as a starting point for the versions your distribution supports.

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.

What Corosync and Pacemaker each do

Corosync and Pacemaker are complementary, not interchangeable. ClusterLabs describes Pacemaker as a high-availability resource manager: it uses Corosync membership and messaging to detect node and resource failures, then applies placement, ordering, and recovery rules. Red Hat documents the same division of responsibility.

Layer Responsibility What it does not provide by itself
Corosync Cluster membership, node-to-node communication, quorum calculation, and transport configuration. It does not start your web server, database, or virtual IP.
Pacemaker Resource placement, dependency constraints, monitoring decisions, and recovery actions. It cannot safely isolate a node without a working fencing integration.
Resource agents Service-specific start, stop, monitor, and sometimes promote/demote operations through OCF or distribution-provided agents. An agent does not replicate application data.
Fence agents (STONITH) Power off or isolate a node through a BMC/IPMI controller, switched PDU, cloud API, or another supported mechanism. Fencing is not a substitute for application-level replication or backups.

Pacemaker can manage almost anything that can be scripted, but the cluster only knows what its resource agent can observe and control. A service that writes state to local disk still needs a separate replicated-data or shared-storage design.

#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.

Choose the topology before installing anything

Start with the failure you are trying to survive and the data path your application requires. Pacemaker does not require shared storage, but a stateful workload must still use either shared storage or an application-specific replication method.

Active/passive

One node runs the service while another is ready to take over. This is straightforward to reason about and is common when an application cannot safely run two writers. Capacity on the standby node remains unused during normal operation.

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

N+1 or active/active placement

Several nodes run independent resources, with at least one node able to absorb a failure. This can use hardware more efficiently, but placement, capacity, and data consistency rules become more demanding. Do not call a design N+1 unless the remaining nodes can actually carry the failed node’s workload.

Shared storage versus replicated data

Shared storage can make a failover path simple, but it creates another dependency that must be redundant and fenced. Replication keeps data on separate nodes but requires the application’s replication, promotion, and recovery semantics. Pacemaker can order those operations; it does not invent them.

Network and membership design

Give every node a stable hostname and address. Provide a resilient path for Corosync traffic where the platform supports it, and separate management, client, and storage traffic when that improves failure isolation. The Ubuntu pcs reference documents knet, UDP, and UDPU transport choices, quorum settings, service startup, waiting for members, and authentication-key synchronization. Select the transport your distribution supports and secure it according to that distribution’s guidance.

Prepare every node

  • Run a supported distribution release and keep the same Corosync, Pacemaker, pcs, resource-agent, and fence-agent versions across the cluster when the distribution recommends that arrangement.
  • Set unique, resolvable hostnames. Verify forward and reverse name resolution, or use a consistently managed hosts file if that is how your environment is operated.
  • Synchronize clocks. Consistent time makes logs, fencing investigations, and maintenance windows understandable.
  • Open the cluster-management and Corosync traffic required by your chosen transport. Do not assume that allowing SSH alone is sufficient.
  • Plan credentials for the cluster administration account and for the fencing device. Keep fencing credentials separate from application credentials.
  • Decide which node can fence which other node and document the path if the ordinary cluster network is unavailable.

Do not add production resources while membership, name resolution, or quorum is still unstable. A clean-looking resource status cannot compensate for an unreliable control plane.

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

Install Corosync, Pacemaker, pcs, and the agents

Install the core daemons on every intended member. ClusterLabs lists these representative commands; package names and versions vary by distribution:

Distribution family Representative command Important qualification
Fedora dnf install -y corosync pacemaker pcs Add the distribution’s resource-agents and fence-agents packages.
RHEL-compatible systems yum install -y corosync pacemaker pcs Use the repositories and package names supported by that release; install resource and fence agents as separate packages where required.
openSUSE zypper install corosync pacemaker Install the matching pcs, resource-agent, and fence-agent packages if they are split out.
Debian-compatible systems apt-get install pacemaker corosync Package names for pcs, resource agents, and fencing integrations differ by release.

ClusterLabs cautions that you will almost certainly need both the resource-agents and fence-agents projects for a usable cluster. Confirm that the specific service agent and fencing agent you intend to use are present before designing your resource commands.

Create the cluster with pcs

The following example uses two nodes named node1 and node2 and a cluster name of ha-cluster. Substitute your actual names in the commands. Run the administrative commands from one node after installing the packages on both.

  1. Set and enable the hacluster account according to your distribution. Then authenticate the nodes. With modern pcs, the password is requested interactively if it is not supplied:

    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 | USB C Dongle with 90W Max Power Delivery, 3×5Gbps USB A Data Ports, for MacBook, Dell, and More (Charger Not Included)
    • 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.

    sudo pcs host auth node1 node2 -u hacluster

  2. Create the Corosync configuration and cluster definition:

    sudo pcs cluster setup ha-cluster node1 node2

    The exact syntax and transport options can differ between pcs releases. Read the local pcs help and distribution reference before applying a command to production.

  3. Enable and start the cluster services on all configured members:

    sudo pcs cluster enable --all
    sudo pcs cluster start --all

    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.
  4. Wait for membership, then inspect status and quorum:

    sudo pcs status
    sudo pcs quorum status

At this stage you want every intended node online, a healthy quorum view, and no unexplained configuration or authentication errors. Stop here and fix membership or transport problems before creating application resources.

Configure and test fencing before services

Fencing, also called STONITH, is the mechanism that prevents a failed or partitioned node from continuing to access resources. Select an agent that can isolate the real hardware or virtual machine, not merely restart a process.

Environment Possible fencing path Design check
Physical servers BMC/IPMI or a switched power distribution unit. The management path must remain usable when the operating-system network is down.
Cloud or virtual infrastructure A supported platform fencing API or hypervisor integration. Credentials and permissions must allow Pacemaker to power off the correct instance.
Other platforms A distribution-supported fence agent for the platform’s controller. Verify that the agent identifies each node unambiguously and reports completion.

Discover the agents installed on your system and read their parameter documentation. A generic creation pattern is:

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

sudo pcs stonith create fence-node1 <fence-agent> <agent-options>

The angle-bracketed values are replaced with the agent name and its documented parameters. Create coverage for every node that may need to be fenced, and restrict each device definition to the hosts it is allowed to isolate. Never paste passwords into a shared shell history or a public runbook.

Use the agent’s test facility or a maintenance-window test to prove that it can power off or isolate the intended node and that the cluster records the result. A configuration that exists but cannot fence on demand is not a safety mechanism.

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.

Set quorum deliberately and prevent split-brain

Quorum normally requires more than half of the configured votes. Red Hat’s Enterprise Linux 10 documentation states: “By default, Pacemaker stops all resources if the cluster loses quorum.” That behavior is protective: if network partitions create two groups that cannot communicate, stopping resources prevents both sides from writing to the same data.

Quorum and fencing solve different parts of the problem. Quorum determines whether a partition is allowed to make cluster decisions; fencing proves that a node which may still be active has been isolated. Disabling fencing merely to make a resource start removes that proof and can turn a recoverable outage into data corruption.

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

Why two nodes need extra planning

In a two-node cluster, losing one node also removes a majority. A surviving node therefore cannot safely assume that it is the only active partition without an additional arbitration design. Plan an independent third vote or another supported quorum mechanism where appropriate.

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. Treat that third vote as an independent failure domain; placing it on the same host, power circuit, or network path as one cluster member defeats the purpose.

Add the virtual IP and service resources

Resources are created through OCF or distribution-provided agents. First create the address clients use, then the service that listens on it. The following commands are illustrative; use the agent and parameters supplied by your distribution.

  1. Create a virtual IP resource. This example uses the commonly available IPaddr2 agent and a documentation-range address:

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

    sudo pcs resource create ClusterIP ocf:heartbeat:IPaddr2 ip=192.0.2.50 cidr_netmask=24 op monitor interval=30s

  2. Create the service resource with the appropriate agent. For an Apache-based service where that agent is installed, a minimal example is:

    sudo pcs resource create WebSite ocf:heartbeat:apache op monitor interval=30s

    If your application uses another daemon, replace the agent and supply its required configuration parameters. An agent that starts a process without checking the application’s real health is insufficient for automatic recovery.

    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 | Data transfer & Fast charging for MacBook, iPhone 17/16/15, iPad, Samsung Galaxy, Apple Watch
    • 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
  3. Require the service to run with the address and start after it:

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

  4. Add location rules only when they represent a real preference or prohibition. For example, a preference can be expressed as:

    sudo pcs constraint location WebSite prefers node1=50

    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.

    Use scores and stickiness intentionally. A preference is not a guarantee, and an explicit prohibition can leave the cluster with nowhere to run a service.

Ordering controls sequence; colocation controls placement; location rules control preferred or prohibited nodes. Keep those concepts separate when troubleshooting. If the application has a database, mounted filesystem, or promotion step, model each dependency with additional resources and constraints rather than relying on startup timing.

Validate the configuration before a failure test

Use the cluster’s own status and history views, not just the service’s process list.

  • pcs status should show quorum, online members, fencing resources, and the expected resource state.
  • pcs quorum status confirms the current vote and quorum view.
  • pcs constraint config (or the equivalent constraint listing for your pcs version) lets you inspect ordering, colocation, and location rules.
  • Review fencing status and history after every fencing test. A successful resource move is not proof that fencing works.
  • Use each resource agent’s monitor operation and logs to confirm that a reported start means the application is actually usable.

Documentation examples show status output containing quorum, node membership, a fence resource, ClusterIP, WebSite, and their constraints. Your names and resource count will differ, but the same categories should be visible.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Rehearse failover in a maintenance window

Test one failure mode at a time and record the expected result before beginning. Have console access to both nodes and a rollback plan.

  1. Planned node evacuation: place one node in standby with sudo pcs node standby node1. Confirm that the virtual IP and service move to the other node, then return the node with sudo pcs node unstandby node1.

    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.
  2. Service failure: use a controlled stop method appropriate to the service and verify that the resource agent detects it, restarts it, or relocates it according to policy. Do not kill an unrelated process and assume the monitor tested the application.

  3. Fencing: execute the approved fence-agent test or isolate a node only when the maintenance plan permits a power or instance interruption. Confirm that Pacemaker records the fence completion before allowing resources to run elsewhere.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  4. Network partition: test the documented partition scenario with console or out-of-band access. Verify quorum behavior, resource stopping, and fencing rather than trying to force both partitions to remain active.

  5. Recovery: restore the failed node, check its logs and fence history, and confirm that it rejoins without unexpectedly reclaiming resources. A recovery runbook should state who clears maintenance mode and when normal placement is restored.

Repeat tests after major operating-system, Corosync, Pacemaker, fencing, storage, or application changes. Failover time is workload- and configuration-dependent; no universal uptime or recovery-time number can be safely applied to every distribution.

Common failure symptoms and corrective actions

The cluster reports no quorum

Check node membership, transport reachability, vote configuration, and the state of any qdevice. Do not override the safety behavior just to start resources. Restore the missing vote or follow the documented emergency procedure for your topology.

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

Fencing is pending or fails

Inspect the fence agent’s credentials, address, permissions, host mapping, and out-of-band network path. Test the device directly during a maintenance window. Until fencing succeeds, treat automatic failover as unsafe.

A resource will not start

Read the resource-agent error and monitor output. Verify that the agent is installed, required parameters and files exist on every node, the service account has access, and ordering or colocation constraints are not leaving the resource without an eligible node.

The virtual IP moves but clients cannot connect

Check that the address is valid for the interface and subnet, the service listens on that address, and upstream network devices learn the move. Pacemaker can place an address correctly while an application or network policy still rejects traffic.

The service returns to an unexpected node

Inspect location scores, resource stickiness, maintenance state, and the current node attributes. Encode a deliberate preference only after confirming that the preferred node has the capacity and data it needs.

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

A node repeatedly disappears

Check Corosync transport, firewall rules, name resolution, time synchronization, and authentication-key consistency. Compare logs on both sides of the membership change and fix the underlying connectivity issue before tuning recovery behavior.

Design choices to document and review

Decision axis Questions to answer
Node count and quorum How many votes are present, what happens when one fails, and where is independent arbitration located?
Fencing independence Can the cluster isolate a node when the ordinary operating-system network is unavailable?
Storage and data Is the application using shared storage, synchronous replication, asynchronous replication, or another recovery method?
Placement model Is the service active/passive, N+1, or sharing capacity across nodes, and can the remaining nodes carry the load?
Transport Which Corosync transport is supported, how is it authenticated or encrypted, and is there path redundancy?
Distribution lifecycle Which package versions, resource agents, and fence agents are supported for the operating-system release?
Operational testing When are node, service, fencing, and partition tests repeated, and who owns the runbook?

Operational rules for a dependable cluster

  • Keep fencing enabled and tested; never treat it as an optional troubleshooting switch.
  • Install resource and fence agents on every node that may host or isolate a resource.
  • Use constraints to express dependencies explicitly instead of relying on command order or luck.
  • Monitor quorum, fencing history, resource-agent failures, and Corosync membership changes.
  • Document the exact node names, addresses, votes, fence mappings, credentials owners, and recovery commands.
  • Patch and upgrade one controlled change at a time, then repeat the failure tests that exercise the changed layer.

A production-ready setup is not the one that merely shows two green nodes. It is the one whose membership, quorum, fencing, resource agents, constraints, data path, and recovery procedure have all been exercised under the failures the service must survive.

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.

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 from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

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.