Pacemaker and Corosync is a popular stack in high availability implementation while pcs (Pacemaker/Corosync Configuration System) immensely simplify configuration of high availability clusters based on both Pacemaker and Corosync.

Pacemaker, Corosync and pcs packages are available in yum's High Availability repository for all off CentOS, RHEL and Fedora and can easily be installed from the terminal.

Steps to install Pacemaker, Corosync and pcs on CentOS, Red Hat or Fedora :

  1. Launch your preferred terminal application.
  2. Enable High Availability repository for yum.
    $ sudo sed -i'' s/^enabled=.*/"enabled=1"/g /etc/yum.repos.d/*-HA.repo
    [sudo] password for user:
  3. Install pacemaker, corosync and pcs packages using yum.
    $ sudo dnf install --assumeyes pacemaker corosync pcs
    CentOS-8 - HA                                                                          409 kB/s | 507 kB     00:01
    Last metadata expiration check: 0:00:01 ago on Sat 18 Jul 2020 08:29:06 PM EDT.
    Dependencies resolved.
    =======================================================================================================================
     Package                            Arch       Version                                      Repository            Size
    =======================================================================================================================
    Installing:
     corosync                           x86_64     3.0.3-2.el8                                  HighAvailability     262 k
     pacemaker                          x86_64     2.0.3-5.el8_2.1                              HighAvailability     435 k
     pcs                                x86_64     0.10.4-6.el8_2.1                             HighAvailability      12 M
    Installing dependencies:
     cifs-utils                         x86_64     6.8-3.el8                                    BaseOS                96 k
     clufter-bin                        x86_64     0.77.1-5.el8                                 HighAvailability      34 k
     clufter-common                     noarch     0.77.1-5.el8                                 HighAvailability      81 k
     corosynclib                        x86_64     3.0.3-2.el8                                  AppStream             65 k
     gssproxy                           x86_64     0.8.0-15.el8                                 BaseOS               118 k
     keyutils                           x86_64     1.5.10-6.el8                                 BaseOS                63 k
     liberation-fonts-common            noarch     1:2.00.3-7.el8                               BaseOS                25 k
     liberation-sans-fonts              noarch     1:2.00.3-7.el8                               BaseOS               610 k
     libknet1                           x86_64     1.10-4.el8                                   HighAvailability      75 k
     libknet1-compress-bzip2-plugin     x86_64     1.10-4.el8                                   HighAvailability      15 k
     libknet1-compress-lz4-plugin       x86_64     1.10-4.el8                                   HighAvailability      16 k
     libknet1-compress-lzma-plugin      x86_64     1.10-4.el8                                   HighAvailability      15 k
     libknet1-compress-lzo2-plugin      x86_64     1.10-4.el8                                   HighAvailability      15 k
     libknet1-compress-plugins-all      x86_64     1.10-4.el8                                   HighAvailability      10 k
     libknet1-compress-zlib-plugin      x86_64     1.10-4.el8                                   HighAvailability      14 k
     libknet1-crypto-nss-plugin         x86_64     1.10-4.el8                                   HighAvailability      19 k
     libknet1-crypto-openssl-plugin     x86_64     1.10-4.el8                                   HighAvailability      17 k
     libknet1-crypto-plugins-all        x86_64     1.10-4.el8                                   HighAvailability      10 k
     libknet1-plugins-all               x86_64     1.10-4.el8                                   HighAvailability      10 k
     libnozzle1                         x86_64     1.10-4.el8                                   HighAvailability      32 k
     libqb                              x86_64     1.0.3-10.el8                                 BaseOS               113 k
     libverto-libevent                  x86_64     0.3.0-5.el8                                  BaseOS                16 k
     net-snmp-libs                      x86_64     1:5.8-14.el8                                 BaseOS               821 k
     nfs-utils                          x86_64     1:2.3.3-31.el8                               BaseOS               468 k
     overpass-fonts                     noarch     3.0.2-3.el8                                  AppStream            1.1 M
     pacemaker-cli                      x86_64     2.0.3-5.el8_2.1                              HighAvailability     327 k
     pacemaker-cluster-libs             x86_64     2.0.3-5.el8_2.1                              AppStream            125 k
     pacemaker-libs                     x86_64     2.0.3-5.el8_2.1                              AppStream            649 k
     pacemaker-schemas                  noarch     2.0.3-5.el8_2.1                              AppStream             65 k
     perl-Carp                          noarch     1.42-396.el8                                 BaseOS                30 k
     perl-Errno                         x86_64     1.28-416.el8                                 BaseOS                76 k
     perl-Exporter                      noarch     5.72-396.el8                                 BaseOS                34 k
     perl-File-Path                     noarch     2.15-2.el8                                   BaseOS                38 k
     perl-IO                            x86_64     1.38-416.el8                                 BaseOS               141 k
     perl-PathTools                     x86_64     3.74-1.el8                                   BaseOS                90 k
     perl-Scalar-List-Utils             x86_64     3:1.49-2.el8                                 BaseOS                68 k
     perl-Socket                        x86_64     4:2.027-3.el8                                BaseOS                59 k
     perl-Text-Tabs+Wrap                noarch     2013.0523-395.el8                            BaseOS                24 k
     perl-Time-Local                    noarch     1:1.280-1.el8                                BaseOS                34 k
     perl-TimeDate                      noarch     1:2.30-13.el8                                AppStream             53 k
     perl-Unicode-Normalize             x86_64     1.25-396.el8                                 BaseOS                82 k
     perl-constant                      noarch     1.33-396.el8                                 BaseOS                25 k
     perl-interpreter                   x86_64     4:5.26.3-416.el8                             BaseOS               6.3 M
     perl-libs                          x86_64     4:5.26.3-416.el8                             BaseOS               1.6 M
     perl-macros                        x86_64     4:5.26.3-416.el8                             BaseOS                72 k
     perl-parent                        noarch     1:0.237-1.el8                                BaseOS                20 k
     perl-threads                       x86_64     1:2.21-2.el8                                 BaseOS                61 k
     perl-threads-shared                x86_64     1.58-2.el8                                   BaseOS                48 k
     python3-clufter                    noarch     0.77.1-5.el8                                 HighAvailability     346 k
     python3-lxml                       x86_64     4.2.3-1.el8                                  AppStream            1.5 M
     python3-pip                        noarch     9.0.3-16.el8                                 AppStream             19 k
     python3-pycurl                     x86_64     7.43.0.2-4.el8                               AppStream            227 k
     python3-setuptools                 noarch     39.2.0-5.el8                                 BaseOS               162 k
     python3-webencodings               noarch     0.5.1-6.el8                                  AppStream             27 k
     python36                           x86_64     3.6.8-2.module_el8.1.0+245+c39af44f          AppStream             19 k
     resource-agents                    x86_64     4.1.1-44.el8_2.3                             HighAvailability     457 k
     rpcbind                            x86_64     1.2.5-7.el8                                  BaseOS                70 k
     ruby                               x86_64     2.5.5-105.module_el8.1.0+214+9be47fd7        AppStream             86 k
     ruby-irb                           noarch     2.5.5-105.module_el8.1.0+214+9be47fd7        AppStream            102 k
     ruby-libs                          x86_64     2.5.5-105.module_el8.1.0+214+9be47fd7        AppStream            2.9 M
     rubygem-json                       x86_64     2.1.0-105.module_el8.1.0+214+9be47fd7        AppStream             90 k
     rubygem-openssl                    x86_64     2.1.2-105.module_el8.1.0+214+9be47fd7        AppStream            190 k
     rubygem-psych                      x86_64     3.0.2-105.module_el8.1.0+214+9be47fd7        AppStream             95 k
     rubygems                           noarch     2.7.6.2-105.module_el8.1.0+214+9be47fd7      AppStream            308 k
    Installing weak dependencies:
     python3-html5lib                   noarch     1:0.999999999-6.el8                          AppStream            214 k
     rubygem-bigdecimal                 x86_64     1.3.4-105.module_el8.1.0+214+9be47fd7        AppStream             97 k
     rubygem-did_you_mean               noarch     1.2.0-105.module_el8.1.0+214+9be47fd7        AppStream             90 k
     rubygem-io-console                 x86_64     0.4.6-105.module_el8.1.0+214+9be47fd7        AppStream             66 k
     rubygem-rdoc                       noarch     6.0.1-105.module_el8.1.0+214+9be47fd7        AppStream            486 k
    Enabling module streams:
     ruby                                          2.5
    
    Transaction Summary
    =======================================================================================================================
    Install  72 Packages
    
    Total download size: 34 M
    Installed size: 93 M
    ##### snipped
  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 /etc/systemd/system/multi-user.target.wants/pacemaker.service → /usr/lib/systemd/system/pacemaker.service.
    Created symlink /etc/systemd/system/multi-user.target.wants/corosync.service → /usr/lib/systemd/system/corosync.service.
    Created symlink /etc/systemd/system/multi-user.target.wants/pcsd.service → /usr/lib/systemd/system/pcsd.service.
  6. Enable firewall rules for high availability.
    $ sudo firewall-cmd --permanent --add-service=high-availability
    success
  7. Reload firewall rules.
    $ sudo firewall-cmd --reload
    success
  8. Set password for hacluster user.
    $ sudo passwd hacluster
    Changing password for user hacluster.
    New password:
    Retype new password:
    passwd: all authentication tokens updated successfully.
  9. Start creating a Pacemaker cluster.
Share this guide!
Discuss the article:

Comment anonymously. Login not required.

Share!