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 both CentOS and RHEL and can easily be installed from the terminal.

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

  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 yum install --assumeyes pacemaker corosync pcs
    ##### snipped
    ============================================================================================================================
     Package                             Arch        Version                                        Repository             Size
    ============================================================================================================================
    Installing:
     corosync                            x86_64      3.0.2-3.el8_1.1                                HighAvailability      261 k
     pacemaker                           x86_64      2.0.2-3.el8_1.2                                HighAvailability      429 k
     pcs                                 x86_64      0.10.2-4.el8                                   HighAvailability       11 M
    Installing dependencies:
     corosynclib                         x86_64      3.0.2-3.el8_1.1                                AppStream              65 k
     overpass-fonts                      noarch      3.0.2-3.el8                                    AppStream             1.1 M
     pacemaker-cluster-libs              x86_64      2.0.2-3.el8_1.2                                AppStream             123 k
     pacemaker-libs                      x86_64      2.0.2-3.el8_1.2                                AppStream             627 k
     pacemaker-schemas                   noarch      2.0.2-3.el8_1.2                                AppStream              62 k
     perl-TimeDate                       noarch      1:2.30-13.el8                                  AppStream              53 k
     python3-lxml                        x86_64      4.2.3-1.el8                                    AppStream             1.5 M
     python3-pip                         noarch      9.0.3-15.el8                                   AppStream              19 k
     python3-pycurl                      x86_64      7.43.0.2-3.el8                                 AppStream             227 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
     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
     cifs-utils                          x86_64      6.8-2.el8                                      BaseOS                 93 k
     gssproxy                            x86_64      0.8.0-14.el8                                   BaseOS                118 k
     keyutils                            x86_64      1.5.10-6.el8                                   BaseOS                 63 k
     liberation-fonts-common             noarch      1:2.00.3-4.el8                                 BaseOS                 26 k
     liberation-sans-fonts               noarch      1:2.00.3-4.el8                                 BaseOS                609 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-10.el8                                   BaseOS                822 k
     nfs-utils                           x86_64      1:2.3.3-26.el8                                 BaseOS                472 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-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-setuptools                  noarch      39.2.0-5.el8                                   BaseOS                162 k
     rpcbind                             x86_64      1.2.5-4.el8                                    BaseOS                 70 k
     clufter-bin                         x86_64      0.77.1-5.el8                                   HighAvailability       34 k
     clufter-common                      noarch      0.77.1-5.el8                                   HighAvailability       81 k
     libknet1                            x86_64      1.10-1.el8_1.2                                 HighAvailability       76 k
     libknet1-compress-bzip2-plugin      x86_64      1.10-1.el8_1.2                                 HighAvailability       15 k
     libknet1-compress-lz4-plugin        x86_64      1.10-1.el8_1.2                                 HighAvailability       16 k
     libknet1-compress-lzma-plugin       x86_64      1.10-1.el8_1.2                                 HighAvailability       15 k
     libknet1-compress-lzo2-plugin       x86_64      1.10-1.el8_1.2                                 HighAvailability       15 k
     libknet1-compress-plugins-all       x86_64      1.10-1.el8_1.2                                 HighAvailability       10 k
     libknet1-compress-zlib-plugin       x86_64      1.10-1.el8_1.2                                 HighAvailability       14 k
     libknet1-crypto-nss-plugin          x86_64      1.10-1.el8_1.2                                 HighAvailability       19 k
     libknet1-crypto-openssl-plugin      x86_64      1.10-1.el8_1.2                                 HighAvailability       17 k
     libknet1-crypto-plugins-all         x86_64      1.10-1.el8_1.2                                 HighAvailability       10 k
     libknet1-plugins-all                x86_64      1.10-1.el8_1.2                                 HighAvailability       10 k
     libnozzle1                          x86_64      1.10-1.el8_1.2                                 HighAvailability       32 k
     pacemaker-cli                       x86_64      2.0.2-3.el8_1.2                                HighAvailability      319 k
     python3-clufter                     noarch      0.77.1-5.el8                                   HighAvailability      346 k
     resource-agents                     x86_64      4.1.1-33.el8                                   HighAvailability      455 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:
     python36                                        3.6
     ruby                                            2.5
    
    Transaction Summary
    ============================================================================================================================
    Install  72 Packages
    
    Total download size: 33 M
    Installed size: 88 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 from /etc/systemd/system/multi-user.target.wants/pacemaker.service to /usr/lib/systemd/system/pacemaker.service.
    Created symlink from /etc/systemd/system/multi-user.target.wants/corosync.service to /usr/lib/systemd/system/corosync.service.
    Created symlink from /etc/systemd/system/multi-user.target.wants/pcsd.service to /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.
Discuss the article:

Comment anonymously. Login not required.

Share!