How to Install Pacemaker in Amazon AMI

AllCloud Blog:
Cloud Insights and Innovation


Pacemaker is a Cluster Resource Manager (CRM) that help running a service in a high availability mode. Using Pacemaker you can create small and large cluster of different services.

Tested On

OS: Amazon Linux AMI release 2012.03
Corosync version: 1.4.1
phpLDAPadmin version: 1.1.8
Hardware: Virtual Machine (AWS AMI)


  • Install Dependencies
yum install make libuuid-devel ncurses-libs kernel-devel flex libtool-ltdl-devel libtool-ltdl libtool 
libcurl-devel git ncurses-devel openssl-devel libselinux-devel cluster-glue-libs-devel libesmtp-devel 
lm_sensors-devel net-snmp-devel asciidoc help2man publican inkscape docbook-style-xsl corosync 
corosynclib-devel automake autoconf libtool-ltdl-devel pkgconfig python glib2-devel libxml2-devel 
libxslt-devel python-devel gcc-c++ bzip2-devel gnutls-devel pam-devel libqb-devel -y
  • Install Pacemaker Repository
wget -O /etc/yum.repos.d/pacemaker.repo
  • Install Pacemaker Repository
yum install libqb libqb-devel libaio-devel -y

DRBD Installation

  • Download and Install drbd-utils
mkdir /usr/local/src/drbd
cd /usr/local/src/drbd
wget -O drbd.tar.gz
tar zxf drbd.tar.gz
cd drbd-*
mkdir -p /usr/src/rpm/SOURCES
make rpm
rpm -Uvh /usr/src/rpm/RPMS/x86_64/drbd-utils-8.3.11-1.x86_64.rpm
  • Configure drbd
cd /etc/drbd.d/
vi r0.res
resource r0 {
  on {
    device    /dev/drbd1;
    disk      /dev/xvdf1;
    meta-disk internal;
  on {
    device    /dev/drbd1;
    disk      /dev/xvdf1;
    meta-disk internal;
drbdadm create-md r0
modprobe drbd
drbdadm up r0
drbdadm -- --overwrite-data-of-peer primary r0
drbdadm primary --force r0
  • Check drbd status
cat /proc/drbd
  • Create file system on the drbd device
mkfs.ext4 /dev/drbd1

Pacemaker Installation

  • Download and install pacemaker
mkdir /usr/local/src/pacemaker
cd /usr/local/src/pacemaker
git clone git://
cd pacemaker
export LIBS=/lib64/
groupadd haclient
useradd -g haclient hacluster
make install
  • Install DRBD-Pacemaker package
rpm -Uvh /usr/src/rpm/RPMS/x86_64/drbd-pacemaker-8.3.11-1.x86_64.rpm
  • Configure Corosync
vi /etc/corosync/corosync.conf
# Please read the corosync.conf.5 manual page
compatibility: whitetank

totem {
        version: 2
        secauth: off
        interface {
                member {
                member {
                ringnumber: 0
                mcastport: 5405
                ttl: 1
        transport: udpu

logging {
        fileline: off
        to_logfile: yes
        to_syslog: no
        debug: on
        logfile: /var/log/cluster/corosync.log
        debug: off
        timestamp: on
        logger_subsys {
                subsys: AMF
                debug: off
vi /etc/corosync/service.d/pcmk
service {
        # Load the Pacemaker Cluster Resource Manager
        name: pacemaker
        ver:  1
  • Start Corosync
service corosync start
chkconfig corosync on
  • Start Pacemaker
service pacemaker start
chkconfig --add pacemaker
chkconfig pacemaker on

Install crmsh For Cluster Configuration

  • Download and Install Reusable Cluster Components (glue)
cd /usr/local/src/pacemaker
wget -O glue.tar.gz
tar zxf glue.tar.gz
cd Reusable-Cluster-Components-glue-*
./ && ./configure && make && make install
  • Download and Install crmsh
cd /usr/local/src/pacemaker
wget -O crmsh.tar.gz
tar zxf crmsh.tar.gz
cd crmsh-*
./ && ./configure && make && make install
  • Download and Install ClusterLabs Resource Agents
cd /usr/local/src/pacemaker
wget -O ocf-scripts.tar.gz
tar zxf ocf-scripts.tar.gz
cd ClusterLabs-resource-agents-*
./ && ./configure && make && make install

Lahav Savir

Founder and CTO, Cloud Platforms

Read more posts by Lahav Savir