you're reading...
Apache, High Availability, Linux, Load Balancing, OpenSource, System Integration

Linux High Availability (Linux-HA)

Linux-HARHEL 5.3 x86_64 installation Notes
1.Install the following Prerequisite packages
# yum install e2fsprogs-devel.x86_64
# yum install glib2-devel.x86_64
# yum install gnutls-devel.x86_64
# yum install ncurses-devel.x86_64
# yum install pam-devel.x86_64
# yum install python-devel.x86_64
# yum install perl-TimeDate.noarch

2.Download LINUX-HA Packages from openSUSE repo;

– heartbeat-2.99.2-8.1.x86_64.rpm
– heartbeat-common-2.99.2-8.1.x86_64.rpm
– heartbeat-resources-2.99.2-8.1.x86_64.rpm
– libheartbeat2-2.99.2-8.1.x86_64.rpm
– libnet-
3. Install the LINUX-HA Packages
# rpm -Uvh libnet-
# rpm -Uvh libheartbeat2-2.99.2-8.1.x86_64.rpm
# rpm -Uvh heartbeat-common-2.99.2-8.1.x86_64.rpm
# rpm -Uvh heartbeat-resources-2.99.2-8.1.x86_64.rpm
# rpm -Uvh heartbeat-2.99.2-8.1.x86_64.rpm
We are Done!

# rpm -qa heartbeat

1) # yum install heartbeat (omit this step if you have performed the above steps)

2) copy configuration files into /etc/ha.d

# cp /usr/share/doc/heartbeat-2.1.3/haresources /etc/ha.d/
# cp /usr/share/doc/heartbeat-2.1.3/ha.cf /etc/ha.d/
# cp /usr/share/doc/heartbeat-2.1.3/authkeys /etc/ha.d/

3) configure authkeys so that nodes exchange the same key

# vi /etc/ha.d/authkeys
auth 2
2 sha1 test-ha

4) put the correct permissions on authkeys

# chmod 600 /etc/ha.d/authkeys

5) Main cluster configuration

# vi /etc/ha.d/ha.cf
logfile /var/log/ha-log
logfacility local0
keepalive 2
deadtime 30
initdead 120
bcast eth0
udpport 694
auto_failback on
node node1
node node2

# uname –n , should output node1 and node2 on the respective nodes

To set the hostname without reboot

# vi /etc/sysconfig/network

# vi /etc/hosts node1 node2

# /etc/init.d/network restart

6) Perform Active / Passive Configuration
Clustered VIP :
Preferred node: node1

# vi /etc/ha.d/haresources

Add the following line at the end of file.
node1 httpd

7. Copy the /etc/ha.d/ directory from node01 to node02:
# scp -r /etc/ha.d/ root@node02:/etc/

8.Add this line in httpd.conf on both nodes:

9.Create the file index.html on both nodes (node01 & node02):

On node01:
# echo “node01 apache test server” > /var/www/html/index.html

On node02:
# echo “node02 apache test server” > /var/www/html/index.html

10.Now start heartbeat on the primary node01 and slave node02:
# /etc/init.d/heartbeat start


Comments are closed.

%d bloggers like this: