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.
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:
Open terminal application.
Update apt's package list from the repository.
See AlsoInstalling - Community Help WikiHow to manually install GRUB after a failed installation...3 Ways to Install Deb Files on Ubuntu & Remove Them LaterInstalling the Ubuntu Restricted Extras Package$ 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.
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.
Make sure pcsd service is started.
$ sudo systemctl start pcsd
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
Configure password for hacluster user.
$ sudo passwd haclusterNew password:Retype new password:passwd: password updated successfully
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)
See AlsoGrub - Debian WikiProceed with Pacemaker cluster configuration.
Related: How to create a Pacemaker cluster
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.
Discuss the article:
Comment anonymously. Login not required.