HighAvailability active-active apache cluster

HA on fedora 8 32bit
************************
install fc8 with text mode and select the necessary packages
configured a host with name and ip:10.1.1.91
________________________________________________
#yum update
#yum install heartbeat

=============================================================================
Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
heartbeat               i386       2.1.3-1.fc8      updates-newkey    1.5 M
Installing for dependencies:
fedora-usermgmt         noarch     0.10-1.fc8       fedora            7.0 k
fedora-usermgmt-core    noarch     0.10-1.fc8       fedora            8.2 k
fedora-usermgmt-default-fedora-setup  noarch     0.10-1.fc8       fedora            6.9 k
fedora-usermgmt-shadow-utils  noarch     0.10-1.fc8       fedora            7.8 k
ipvsadm                 i386       1.24-9           fedora             31 k
ldirectord              i386       2.1.3-1.fc8      updates-newkey    107 k
lm_sensors              i386       2.10.6-2.fc8     updates-newkey    500 k
net-snmp-libs           i386       1:5.4.1-8.fc8    updates-newkey    1.2 M
perl-MailTools          noarch     1.77-2.fc8       fedora             89 k
perl-TimeDate           noarch     1:1.16-6.fc8     fedora             33 k
pils                    i386       2.1.3-1.fc8      updates-newkey     88 k
stonith                 i386       2.1.3-1.fc8      updates-newkey    162 k

Transaction Summary
=============================================================================
Install     13 Package(s)
Update       0 Package(s)
Remove       0 Package(s)
Total download size: 3.7 M

#cp /usr/share/doc/heartbeat-2.1.3/authkeys /etc/ha.d/
#cp /usr/share/doc/heartbeat-2.1.3/ha.cf /etc/ha.d/
#cp /usr/share/doc/heartbeat-2.1.3/haresources /etc/ha.d/
# vim /etc/ha.d/authkeys
auth 2
2 sha1 test!
#chmod 600 /etc/ha.d/authkeys
#vim /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 nod1
node node2   has to configure later
#vi /etc/ha.d/haresources  ( same has to do it on other node )
nod1 10.1.1.91 httpd
#vim /etc/httpd/conf/httpd.conf ( same has to do it on other node )
#Listen 80
Listen 10.1.1.91:80
on nod1
#echo “node1 apache test server” > /var/www/html/index.html
[root@nod1 heartbeat-2.1.3]# /etc/init.d/heartbeat start
Starting High-Availability services:
2010/09/28_10:55:07 INFO:  Resource is stopped
[  OK  ]
[root@nod1 heartbeat-2.1.3]#
[root@nod1 heartbeat-2.1.3]# service status heartbeat
status: unrecognized service
[root@nod1 heartbeat-2.1.3]# service heartbeat status
heartbeat OK [pid 2684 et al] is running on nod1 [nod1]…

[root@nod1 heartbeat-2.1.3]# ps -aux |grep heartbeat
Warning: bad syntax, perhaps a bogus ‘-‘? See /usr/share/doc/procps-3.2.7/FAQ
root      2684  0.1  2.4  12416 12416 ?        SLs  10:55   0:00 heartbeat: master control process
nobody    2687  0.0  1.1   5820  5820 ?        SL   10:55   0:00 heartbeat: FIFO reader
nobody    2688  0.0  1.1   5816  5816 ?        SL   10:55   0:00 heartbeat: write: bcast eth0
nobody    2689  0.0  1.1   5816  5816 ?        SL   10:55   0:00 heartbeat: read: bcast eth0
root      2704  0.0  0.1   4040   700 pts/0    S+   10:56   0:00 grep heartbeat
[root@nod1 heartbeat-2.1.3]#
[root@nod1 heartbeat-2.1.3]# netstat -lnpt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0      0 0.0.0.0:51948               0.0.0.0:*                   LISTEN      1998/rpc.statd
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      1980/rpcbind
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      2185/sendmail: acce
tcp        0      0 :::22                       :::*                        LISTEN      2164/sshd

[root@nod1 heartbeat-2.1.3]# service httpd status
httpd is stopped
[root@nod1 heartbeat-2.1.3]# service httpd start
Starting httpd: httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName
[  OK  ]
[root@nod1 heartbeat-2.1.3]# service httpd status
httpd (pid 2775 2774 2773 2772 2771 2770 2769 2768 2766) is running…
——————————————————-
/sbin/ip addr add 10.1.1.93/24 dev eth0
[root@nod1 html]# /sbin/ip addr add 10.1.1.93/24 dev eth0
[root@nod1 html]# service network restart
Shutting down interface eth0:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:
————————————————————-
system-config-firewall-tui   to edit firewall configurations

when try http://10.1.1.91/ should get “node1 apache test server ”

Now create virtual ip for the network
______________________________________
ifconfig eth0:1 10.1.1.93 netmask 255.255.255.0   up

and change vi /etc/ha.d/haresources
Add the following line:node1 10.1.1.93 httpd

then vi /etc/httpd/conf/httpd.conf
Listen 10.1.1.93:80

and now http://10.1.1.93/   should get “node1 apache test server ”

configured a host with name and ip:10.1.1.92
________________________________________________
#yum update
#yum install heartbeat
#cp /usr/share/doc/heartbeat-2.1.3/authkeys /etc/ha.d/
#cp /usr/share/doc/heartbeat-2.1.3/ha.cf /etc/ha.d/
#cp /usr/share/doc/heartbeat-2.1.3/haresources /etc/ha.d/
# vim /etc/ha.d/authkeys
auth 2
2 sha1 test!
#chmod 600 /etc/ha.d/authkeys
#vim /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 nod1
node node2   has to configure later
#vi /etc/ha.d/haresources  ( same has to do it on other node )
nod2 10.1.1.93 httpd
#vim /etc/httpd/conf/httpd.conf ( same has to do it on other node )
#Listen 80
Listen 10.1.1.93:80

#echo “nod2 apache test server” > /var/www/html/index.html
[root@nod2 heartbeat-2.1.3]# /etc/init.d/heartbeat start

Now create virtual ip for the network
______________________________________
ifconfig eth0:1 10.1.1.93 netmask 255.255.255.0   up
system-config-firewall-tui   to edit firewall configurations
/etc/init.d/heartbeat start

Advertisements

Posted on July 12, 2011, in LInux Based, Uncategorized, Web. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: