How to install Pacemaker, Corosync and pcs on Ubuntu or Debian (2024)

Pacemaker and Corosync is one of the most used high availability cluster stacks. On the other hand, pcs or Pacemaker/Corosync Configuration System is a tool to configure both Pacemaker and Corosync easily.

How to install Pacemaker, Corosync and pcs on Ubuntu or Debian (1)

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 http://jp.archive.ubuntu.com/ubuntu focal InReleaseGet:2 http://jp.archive.ubuntu.com/ubuntu focal-updates InRelease [111 kB]Get:3 http://jp.archive.ubuntu.com/ubuntu focal-backports InRelease [98.3 kB]Get:4 http://jp.archive.ubuntu.com/ubuntu focal-security InRelease [107 kB]Get:5 http://jp.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [255 kB]Get:6 http://jp.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [132 kB]Fetched 704 kB in 2s (322 kB/s)Reading package lists... DoneBuilding dependency treeReading state information... DoneAll packages are up to date.
  3. Install pacemaker, corosync and pcs packages using apt.

    $ sudo apt install --assume-yes pacemaker corosync pcsReading package lists... DoneBuilding dependency treeReading state information... DoneThe following additional packages will be installed: cluster-glue crmsh fonts-dejavu-core fonts-lato fonts-liberation javascript-common libcfg7 libcib27 libcmap4 libcorosync-common4 libcpg4 libcrmcluster29 libcrmcommon34 libcrmservice28 libjs-jquery libknet1 liblrm2 liblrmd28 libmysqlclient21 libnet1 libnl-route-3-200 libnozzle1 libnspr4 libnss3 libopenhpi3 libopenipmi0 libpacemaker1 libpe-rules26 libpe-status28 libpils2 libplumb2 libplumbgpl2 libqb-dev libqb0 libquorum5 libruby2.7 libsensors-config libsensors5 libsnmp-base libsnmp35 libstatgrab10 libstonith1 libstonithd26 libtimedate-perl libvotequorum8 libxml2-utils mysql-common net-tools openhpid pacemaker-cli-utils pacemaker-common pacemaker-resource-agents python3-bs4 python3-dateutil python3-html5lib python3-lxml python3-parallax python3-pycurl python3-soupsieve python3-tornado python3-webencodings rake resource-agents ruby ruby-backports ruby-ethon ruby-ffi 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.7 rubygems-integration unzip xsltproc zipSuggested packages: ipmitool csync2 ocfs2-tools sbd vim-addon-manager apache2 | lighttpd | httpd libqb-doc 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 bundlerThe following NEW packages will be installed: cluster-glue corosync crmsh fonts-dejavu-core fonts-lato fonts-liberation javascript-common libcfg7 libcib27 libcmap4 libcorosync-common4 libcpg4 libcrmcluster29 libcrmcommon34 libcrmservice28 libjs-jquery libknet1 liblrm2 liblrmd28 libmysqlclient21 libnet1 libnl-route-3-200 libnozzle1 libnspr4 libnss3 libopenhpi3 libopenipmi0 libpacemaker1 libpe-rules26 libpe-status28 libpils2 libplumb2 libplumbgpl2 libqb-dev libqb0 libquorum5 libruby2.7 libsensors-config libsensors5 libsnmp-base libsnmp35 libstatgrab10 libstonith1 libstonithd26 libtimedate-perl libvotequorum8 libxml2-utils mysql-common net-tools openhpid pacemaker pacemaker-cli-utils pacemaker-common pacemaker-resource-agents pcs python3-bs4 python3-dateutil python3-html5lib python3-lxml python3-parallax python3-pycurl python3-soupsieve python3-tornado python3-webencodings rake resource-agents ruby ruby-backports ruby-ethon ruby-ffi 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.7 rubygems-integration unzip xsltproc zip0 upgraded, 88 newly installed, 0 to remove and 0 not upgraded.Need to get 20.9 MB of archives.After this operation, 90.3 MB of additional disk space will be used.
  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 pcsdSynchronizing state of pacemaker.service with SysV service script with /lib/systemd/systemd-sysv-install.Executing: /lib/systemd/systemd-sysv-install enable pacemakerSynchronizing state of corosync.service with SysV service script with /lib/systemd/systemd-sysv-install.Executing: /lib/systemd/systemd-sysv-install enable corosyncSynchronizing state of pcsd.service with SysV service script with /lib/systemd/systemd-sysv-install.Executing: /lib/systemd/systemd-sysv-install enable pcsd
  6. Configure password for hacluster user.

    $ sudo passwd haclusterNew 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/tcpRules updatedRules updated (v6)$ sudo ufw allow 5405/udpRules updatedRules updated (v6)$ sudo ufw reloadFirewall not enabled (skipping reload)
  8. Proceed with Pacemaker cluster configuration.

How to install Pacemaker, Corosync and pcs on Ubuntu or Debian (2)

How to install Pacemaker, Corosync and pcs on Ubuntu or Debian (3)

Author: Mohd Shakir Zakaria
Mohd Shakir Zakaria is an experienced cloud architect with a strong development and open-source advocacy background. He boasts multiple certifications in AWS, Red Hat, VMware, ITIL, and Linux, underscoring his expertise in cloud architecture and system administration.

How to install Pacemaker, Corosync and pcs on Ubuntu or Debian (4) How to install Pacemaker, Corosync and pcs on Ubuntu or Debian (5)How to install Pacemaker, Corosync and pcs on Ubuntu or Debian (6) How to install Pacemaker, Corosync and pcs on Ubuntu or Debian (7)

Discuss the article:

Comment anonymously. Login not required.

How to install Pacemaker, Corosync and pcs on Ubuntu or Debian (2024)
Top Articles
Latest Posts
Article information

Author: Ms. Lucile Johns

Last Updated:

Views: 6126

Rating: 4 / 5 (61 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Ms. Lucile Johns

Birthday: 1999-11-16

Address: Suite 237 56046 Walsh Coves, West Enid, VT 46557

Phone: +59115435987187

Job: Education Supervisor

Hobby: Genealogy, Stone skipping, Skydiving, Nordic skating, Couponing, Coloring, Gardening

Introduction: My name is Ms. Lucile Johns, I am a successful, friendly, friendly, homely, adventurous, handsome, delightful person who loves writing and wants to share my knowledge and understanding with you.