Skip to content

InstallDrbdAndPacemakerOnCentos6.3

caffeine edited this page Oct 23, 2013 · 1 revision

Installation of DRBD on rozofs exports servers

Add extra package repository

First we need to instal ELREPO extra package repository from where DRBD can be installed, as the package DRBD does not come in the default yum repositories.

On fizian-poc-01 and fizian-poc-02:

$ rpm -Uvh http://elrepo.org/elrepo-release-6-4.el6.elrepo.noarch.rpm

Install DRBD 8.4.1

On fizian-poc-01 and fizian-poc-02:

$ yum install drbd84-utils  kmod-drbd84

Disable iptables

CentOS 6.3 comes with a firewall installed by default.

On fizian-poc-01 and fizian-poc-02:

$ /etc/init.d/iptables stop
$ chkconfig iptables off

Check the hostname of each server

Create file: /etc/drbd.d/rozofsexport.res

resource rozofsexport {
	    meta-disk internal;
	    device  /dev/drbd1;
	    disk    /dev/sda3;

	    syncer {
	            verify-alg sha1;
	    }

	    on fizian-poc-01 {
	            address   192.168.5.1:7789;
	    }

	    on fizian-poc-02 {
	            address   192.168.5.2:7789;
	    }

	    net {
	            # Automatic split brain recovery policies
	            after-sb-0pri discard-zero-changes;
	            after-sb-1pri discard-secondary;
	            after-sb-2pri call-pri-lost-after-sb;
	    }
}

Now we have to create the metadata on both servers:

$ drbdadm create-md rozofsexport

start DRBD service on both servers:

$ service drbd start

initial device synchronisation

$ drbdadm primary --force rozofsexport

Check that devices are syncing

$ service drbd status

Make the ext4 on /dev/sda3

$ mkfs.ext4 /dev/sda3

Disable DRBD on startup:

$ chkconfig drbd off

Installation of PACEMAKER on rozofs exports servers

Install packages

$ yum install pacemaker cman ccs resource-agents

Configure Cluster Membership and Messaging

$ ccs -f /etc/cluster/cluster.conf --createcluster pacemaker1
$ ccs -f /etc/cluster/cluster.conf --addnode node1 
$ ccs -f /etc/cluster/cluster.conf --addnode node2


$ ccs -f /etc/cluster/cluster.conf --addfencedev pcmk agent=fence_pcmk  
$ ccs -f /etc/cluster/cluster.conf --addmethod pcmk-redirect node1 
$ ccs -f /etc/cluster/cluster.conf --addmethod pcmk-redirect node2  
$ ccs -f /etc/cluster/cluster.conf --addfenceinst pcmk node1 pcmk-redirect port=node1 
$ ccs -f /etc/cluster/cluster.conf --addfenceinst pcmk node2 pcmk-redirect port=node2