==================================================
All Config in LB0 (Master Node)
ip 10.0.1.49
==================================================

============ lb0 ============================

lb0:/home/golf# more /etc/ha.d/ha.cf 
#All log 
debugfile /var/log/ha-debug
logfile /var/log/ha-log
logfacility local0
#Broadcast to HA link
bcast eth2  # Linux
#Use auto_failback for master/slave statement
auto_failback on
#which node that show in HA group
node lb0
node lb2
#Use with ping node when network down , protect single point of failer.
ping 10.0.0.254
ping 192.168.0.6
respawn hacluster /usr/lib/heartbeat/ipfail
apiauth ipfail gid=haclient uid=hacluster

====================================

lb0:/home/golf# more /etc/ha.d/haresources 
     
lb0        ldirectord::ldirectord.cf 
lb0        LVSSyncDaemonSwap::master 
lb0        IPaddr2::10.0.1.152/23/eth0 
lb0	   IPaddr2::192.168.0.254/24/eth1

====================================

lb0:/home/golf# more /etc/ha.d/authkeys 
auth1
1 sha1 ultramonkey

=====================================

lb0:/#more /etc/network/interface
 
#Public ip (fake)
# The primary network interface
allow-hotplug eth0
iface eth0 inet static
        address 10.0.1.149
        netmask 255.255.254.0
        network 10.0.0.0
        broadcast 10.0.1.255
        gateway 10.0.0.254
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 203.144.168.6
        dns-search ntt.co.th

#Private ip connect private network
auto eth1
iface eth1 inet static
        address 192.168.0.1
        netmask 255.255.255.0
        network 192.168.0.255

#Check Heartbeat with other node
auto eth2
iface eth2 inet static
        address 172.16.0.2
        netmask 255.255.255.248
        network 172.16.0.7

=========================================================================================

lb0:/home/golf# more /etc/ha.d/ldirectord.cf 
# Global Directives
checktimeout=10
checkinterval=2
#fallback=127.0.0.1:80
autoreload=no
logfile="/var/log/ldirectord.log"
logfile="local0"
quiescent=yes

# Virtual Server for HTTP
#virtual=10.0.1.152:80
#        #fallback=127.0.0.1:80
#        real=192.168.0.4:80 masq 2 
#        real=192.168.0.5:80 masq 1 
#        service=http
#        #request="test.html"
#        #receive="Test Page"
#        scheduler=wrr
#        #persistent=600
#        protocol=tcp
#       checktype=negotiate
virtual=10.0.1.152:25
        #fallback=127.0.0.1:80
        real=192.168.0.7:25 masq 1 
        real=192.168.0.6:25 masq 1
        service=smtp
        #request="test.html"
        #receive="Test Page"
        scheduler=wrr
        #persistent=600
        protocol=tcp
        checktype=negotiate

==============================================================================

#config in file /etc/hosts for ping to other node of HA
lb0:/home/golf# more /etc/hosts
127.0.0.1       localhost
10.0.1.149      lb0.ntt.co.th   lb0
10.0.1.146      lb2.ntt.co.th   lb2



# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

================================================================================
OS Debian 4.0 R1 = Linux lb0 2.6.18-5-686 #1 
================================================================================


================================================================================
Other Node LB2 (slave node)
ip 10.0.1.146
================================================================================
============ lb2 ============================

lb2:/home/golf# more /etc/ha.d/ha.cf 
#All log 
debugfile /var/log/ha-debug
logfile /var/log/ha-log
logfacility local0
#Broadcast to HA link
bcast eth2  # Linux
#Use auto_failback for master/slave statement
auto_failback on
#which node that show in HA group
node lb0
node lb2
#Use with ping node when network down , protect single point of failer.
ping 10.0.0.254
ping 192.168.0.6
respawn hacluster /usr/lib/heartbeat/ipfail
apiauth ipfail gid=haclient uid=hacluster

====================================

lb2:/home/golf# more /etc/ha.d/haresources 
     
lb0        ldirectord::ldirectord.cf 
lb0        LVSSyncDaemonSwap::master 
lb0        IPaddr2::10.0.1.152/23/eth0 
lb0	   IPaddr2::192.168.0.254/24/eth1

====================================

lb2:/home/golf# more /etc/ha.d/authkeys 
auth1
1 sha1 ultramonkey

=====================================

lb2:/#more /etc/network/interface
 
#Public ip (fake)
# The primary network interface
allow-hotplug eth0
iface eth0 inet static
        address 10.0.1.146
        netmask 255.255.254.0
        network 10.0.0.0
        broadcast 10.0.1.255
        gateway 10.0.0.254
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 203.144.168.6
        dns-search ntt.co.th

#Private ip connect private network
auto eth1
iface eth1 inet static
        address 192.168.0.2
        netmask 255.255.255.0
        network 192.168.0.255

#Check Heartbeat with other node
auto eth2
iface eth2 inet static
        address 172.16.0.1
        netmask 255.255.255.248
        network 172.16.0.7

=========================================================================================

lb2:/home/golf# more /etc/ha.d/ldirectord.cf 
# Global Directives
checktimeout=10
checkinterval=2
#fallback=127.0.0.1:80
autoreload=no
logfile="/var/log/ldirectord.log"
logfile="local0"
quiescent=yes

# Virtual Server for HTTP
#virtual=10.0.1.152:80
#        #fallback=127.0.0.1:80
#        real=192.168.0.4:80 masq 2 
#        real=192.168.0.5:80 masq 1 
#        service=http
#        #request="test.html"
#        #receive="Test Page"
#        scheduler=wrr
#        #persistent=600
#        protocol=tcp
#       checktype=negotiate
virtual=10.0.1.152:25
        #fallback=127.0.0.1:80
        real=192.168.0.7:25 masq 1 
        real=192.168.0.6:25 masq 1
        service=smtp
        #request="test.html"
        #receive="Test Page"
        scheduler=wrr
        #persistent=600
        protocol=tcp
        checktype=negotiate

==============================================================================

#config in file /etc/hosts for ping to other node of HA
lb2:/home/golf# more /etc/hosts
127.0.0.1       localhost
10.0.1.149      lb0.ntt.co.th   lb0
10.0.1.146      lb2.ntt.co.th   lb2



# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts


