nuffnang

Thursday 26 May 2011

Linux HA (High Availability)


What is High Availabilty??
from wikipedia-->High availability is a system design approach and associated service implementation that ensures a prearranged level of operational performance will be met during a contractual measurement period.

from me --> to ensure server uptime and availability to 99.9999% or in other words 30 seconds down time per year! How to achieve that availabilty? yes, using HA.

 HA using failover mechanism to ensure availabilty. Refer diagram belows (credit to Alan Robertson HA Linux Projects):

Diagram shows physical failover mechanism with Disaster Recovery Center (DRC) and using replication method to mirroring storage. I will show how to use DRBD (Distributed Replicated Block Device) that we can understood by network raid level 1 later on.

First thing what we need is rpm installer, although somebody will use compiling from source code method, but im tired of compiling dependencies issues so just use rpm.

For RHEL you can use centos rpm found here:Centos i386 RPM repos,

Get
1.heartbeat-2.1.3-3.el5.centos.i386.rpm
2.heartbeat-pils-2.1.3-3.el5.centos.i386.rpm
3.heartbeat-stonith-2.1.3-3.el5.centos.i386.rpm

Installation(both servers):


1.put those three files in your RHEL folder (any folder that you comfort with).

2. run heartbeat pils follow by stonith and heartbeat 2.1.3
root@localhost#rpm -ivf heartbeat-pils-2.1.3-3.el5.centos.i386.rpm

root@localhost#rpm -ivf  heartbeat-stonith-2.1.3-3.el5.centos.i386.rpm

root@localhost#rpm -ivf heartbeat-2.1.3-3.el5.centos.i386.rpm

Configuring HA:

There are 3 files needed for HA to run:
1.authkeys
2.ha.cf
3.haresources
These 3 files should located at /etc/ha.d

in authkeys files:
auth 2
2 sha1 yourpassword


in ha.cf:

 logfile /var/log/ha-log
logfacility local0
keepalive 2
deadtime 30
initdead 120
bcast eth0
udpport 694
auto_failback on
node node01(your server hostname)
node node02 (your backup hostname)

in haresources (this is what to be failover):
 hostname ipaddress httpd(depends on your failover service requirement)


both server must have same configuration files.

try to start your heartbeat:

root@localhost#service heartbeat start


Stay tune for DRBD!

any enquiries please put comments...

No comments:

Post a Comment