Pacemaker and Corosync is one of the mostly used high availability cluster stack. pcs or Pacemaker/Corosync Configuration System on the other hand is a tool to easily configure both Pacemaker and Corosync.

Pacemaker, Corosync and pcs are all available in Ubuntu and Debian default apt repository, and can easily be installed and configured at the terminal.

Steps to install Pacemaker, Corosync and pcs on Ubuntu or Debian:

  1. Open terminal application.
  2. Update apt's package list from the repository.
    $ sudo apt update
    [sudo] password for user:
    Hit:1 disco InRelease
    Get:2 disco-updates InRelease [97.5 kB]
    Get:3 disco-backports InRelease [88.8 kB]
    Get:4 disco-security InRelease [97.5 kB]
    Fetched 284 kB in 1s (337 kB/s)
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    All packages are up to date.
  3. Install pacemaker, corosync and pcs packages using apt.
    $ sudo apt install --assume-yes pacemaker corosync pcs
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following additional packages will be installed:
      cluster-glue fonts-dejavu-core fonts-lato fonts-liberation javascript-common libcfg7 libcib27 libcmap4 libcorosync-common4 libcpg4 libcrmcluster29 libcrmcommon34 libcrmservice28 libjs-jquery
      libknet1 liblrm2 liblrmd28 libltdl7 libmysqlclient21 libnet1 libnspr4 libnss3 libopenhpi3 libopenipmi0 libpe-rules26 libpe-status28 libpengine27 libpils2 libplumb2 libplumbgpl2 libqb0 libquorum5
      libruby2.5 libsensors-config libsensors5 libsnmp-base libsnmp30 libstatgrab10 libstonith1 libstonithd26 libtimedate-perl libtransitioner25 libvotequorum8 libxml2-utils mysql-common net-tools
      openhpid pacemaker-cli-utils pacemaker-common pacemaker-resource-agents python3-bs4 python3-html5lib python3-lxml python3-pycurl python3-soupsieve python3-tornado python3-webencodings rake
      resource-agents ruby ruby-backports ruby-did-you-mean ruby-ethon ruby-ffi ruby-json ruby-mime-types ruby-mime-types-data ruby-minitest ruby-mustermann ruby-net-telnet ruby-open4 ruby-power-assert
      ruby-rack ruby-rack-protection ruby-sinatra ruby-test-unit ruby-tilt ruby-xmlrpc ruby2.5 rubygems-integration unzip xsltproc zip
    Suggested packages:
      ipmitool apache2 | lighttpd | httpd lm-sensors snmp-mibs-downloader fence-agents python3-genshi python3-lxml-dbg python-lxml-doc libcurl4-gnutls-dev python-pycurl-doc python3-pycurl-dbg
      python-tornado-doc python3-googleapi ri ruby-dev bundle
  4. Make sure pcsd service is started.
    $ sudo systemctl start pcsd
  5. Configure pacemaker, corosync and pcsd services to automatically start during system boot.
    $ sudo systemctl enable pacemaker corosync pcsd
    Created symlink from /etc/systemd/system/ to /usr/lib/systemd/system/pacemaker.service.
    Created symlink from /etc/systemd/system/ to /usr/lib/systemd/system/corosync.service.
    Created symlink from /etc/systemd/system/ to /usr/lib/systemd/system/pcsd.service.
  6. Configure password for hacluster user.
    $ sudo passwd hacluster
    New password:
    Retype new password:
    passwd: password updated successfully
  7. Configure firewall rules for required ports using ufw (optional, if firewall is enabled).
    $ sudo ufw allow 2224,3121,21064/tcp
    Rules updated
    Rules updated (v6)
    $ sudo ufw allow 5405/udp
    Rules updated
    Rules updated (v6)
    $ sudo ufw reload
    Firewall not enabled (skipping reload)
  8. Proceed with Pacemaker cluster configuration.
Discuss the article:

Comment anonymously. Login not required.