Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Heartbeat Cluster and apache

Status
Not open for further replies.
Sep 5, 2004
55
CH
Hi all

i installed a heartbeat based Linux Cluster (a RH 7.2 Box and a Gentoo Box)

so far so good... the cluster works, but if one node is fail, the healthy node won't failover, which means the websites aren't available


the logs are looking ok, but where is the problem?
(see log below from the secondary node):
-----------------------------------------------------------
heartbeat: 2005/01/15_21:08:17 info: remote resource transition completed.
heartbeat: 2005/01/15_21:08:17 info: Local Resource acquisition completed.
heartbeat: 2005/01/15_21:08:17 info: Running /etc/ha.d/rc.d/ip-request-resp ip-request-resp
heartbeat: 2005/01/15_21:08:17 received ip-request-resp 10.0.0.3 OK yes
heartbeat: 2005/01/15_21:08:17 info: Acquiring resource group: anita.elvisaltherr.ch 10.0.0.3 apache
heartbeat: 2005/01/15_21:08:17 info: Running /etc/ha.d/resource.d/IPaddr 10.0.0.3 start
heartbeat: 2005/01/15_21:08:18 info: /sbin/ifconfig eth1:0 10.0.0.3 netmask 255.255.255.0 broadcast 10.0.0.255
heartbeat: 2005/01/15_21:08:18 info: Sending Gratuitous Arp for 10.0.0.3 on eth1:0 [eth1]
heartbeat: 2005/01/15_21:08:18 /usr/lib/heartbeat/send_arp -i 1010 -r 5 -p /var/lib/heartbeat/rsctmp/send_arp/send_arp-10.0.0.3 eth1 10.0.0.3 auto 10.0.0.3 ffffffffffff
heartbeat: 2005/01/15_21:08:18 info: Running /etc/ha.d/resource.d/apache start
heartbeat: 2005/01/15_21:09:06 info: Received shutdown notice from 'websrv01.elvisaltherr.ch'.
heartbeat: 2005/01/15_21:09:06 info: Resources being acquired from websrv01.elvisaltherr.ch.
heartbeat: 2005/01/15_21:09:06 info: acquire local HA resources (standby).
heartbeat: 2005/01/15_21:09:06 info: Acquiring resource group: anita.elvisaltherr.ch 10.0.0.3 apache
heartbeat: 2005/01/15_21:09:07 info: Local Resource acquisition completed.
heartbeat: 2005/01/15_21:09:07 info: Running /etc/ha.d/resource.d/apache start
heartbeat: 2005/01/15_21:09:07 info: local HA resource acquisition completed (standby).
heartbeat: 2005/01/15_21:09:07 info: Standby resource acquisition done [all].
heartbeat: 2005/01/15_21:09:07 info: Running /etc/ha.d/rc.d/status status
heartbeat: 2005/01/15_21:09:07 info: /usr/lib/heartbeat/mach_down: nice_failback: foreign resources acquired
heartbeat: 2005/01/15_21:09:07 info: mach_down takeover complete.
heartbeat: 2005/01/15_21:09:07 info: mach_down takeover complete for node websrv01.elvisaltherr.ch.
heartbeat: 2005/01/15_21:09:37 WARN: node websrv01.elvisaltherr.ch: is dead
heartbeat: 2005/01/15_21:09:37 info: Dead node websrv01.elvisaltherr.ch gave up resources.
heartbeat: 2005/01/15_21:09:37 info: Link websrv01.elvisaltherr.ch:eth1 dead.
heartbeat: 2005/01/15_21:09:37 info: Link websrv01.elvisaltherr.ch:/dev/ttyS1 dead.
heartbeat: 2005/01/15_21:09:53 info: Heartbeat restart on node websrv01.elvisaltherr.ch
heartbeat: 2005/01/15_21:09:53 info: Link websrv01.elvisaltherr.ch:eth1 up.
heartbeat: 2005/01/15_21:09:53 info: Status update for node websrv01.elvisaltherr.ch: status up
heartbeat: 2005/01/15_21:09:53 info: Running /etc/ha.d/rc.d/status status
heartbeat: 2005/01/15_21:09:53 info: Status update for node websrv01.elvisaltherr.ch: status active
heartbeat: 2005/01/15_21:09:53 info: remote resource transition completed.
heartbeat: 2005/01/15_21:09:53 info: anita.elvisaltherr.ch wants to go standby [foreign]
heartbeat: 2005/01/15_21:09:53 info: standby: websrv01.elvisaltherr.ch can take our foreign resources
heartbeat: 2005/01/15_21:09:53 info: give up foreign HA resources (standby).
heartbeat: 2005/01/15_21:09:53 info: Running /etc/ha.d/rc.d/status status
heartbeat: 2005/01/15_21:09:54 info: Link websrv01.elvisaltherr.ch:/dev/ttyS1 up.
heartbeat: 2005/01/15_21:10:09 info: foreign HA resource release completed (standby).
heartbeat: 2005/01/15_21:10:09 info: Local standby process completed [foreign].
heartbeat: 2005/01/15_21:10:10 WARN: 1 lost packet(s) for [websrv01.elvisaltherr.ch] [15:17]
heartbeat: 2005/01/15_21:10:10 info: remote resource transition completed.
heartbeat: 2005/01/15_21:10:10 info: No pkts missing from websrv01.elvisaltherr.ch!
heartbeat: 2005/01/15_21:10:10 info: Other node completed standby takeover of foreign resources.
heartbeat: 2005/01/15_21:11:35 info: Received shutdown notice from 'websrv01.elvisaltherr.ch'.
heartbeat: 2005/01/15_21:11:35 info: Resources being acquired from websrv01.elvisaltherr.ch.
heartbeat: 2005/01/15_21:11:35 info: acquire local HA resources (standby).
heartbeat: 2005/01/15_21:11:35 info: Acquiring resource group: anita.elvisaltherr.ch 10.0.0.3 apache
heartbeat: 2005/01/15_21:11:35 info: Local Resource acquisition completed.
heartbeat: 2005/01/15_21:11:35 info: Running /etc/ha.d/resource.d/apache start
heartbeat: 2005/01/15_21:11:36 info: local HA resource acquisition completed (standby).
heartbeat: 2005/01/15_21:11:36 info: Standby resource acquisition done [foreign].
heartbeat: 2005/01/15_21:11:36 info: Running /etc/ha.d/rc.d/status status
heartbeat: 2005/01/15_21:11:36 info: /usr/lib/heartbeat/mach_down: nice_failback: foreign resources acquired
heartbeat: 2005/01/15_21:11:36 info: mach_down takeover complete.
heartbeat: 2005/01/15_21:11:36 info: mach_down takeover complete for node websrv01.elvisaltherr.ch.
heartbeat: 2005/01/15_21:12:06 WARN: node websrv01.elvisaltherr.ch: is dead
heartbeat: 2005/01/15_21:12:06 info: Dead node websrv01.elvisaltherr.ch gave up resources.
heartbeat: 2005/01/15_21:12:06 info: Link websrv01.elvisaltherr.ch:eth1 dead.
heartbeat: 2005/01/15_21:12:06 info: Link websrv01.elvisaltherr.ch:/dev/ttyS1 dead.
heartbeat: 2005/01/15_21:12:31 WARN: TTY write timeout on [/dev/ttyS1] (no connection or bad cable? [see documentation])
heartbeat: 2005/01/15_21:10:10 info: No pkts missing from websrv01.elvisaltherr.ch!
heartbeat: 2005/01/15_21:10:10 info: Other node completed standby takeover of foreign resources.
heartbeat: 2005/01/15_21:11:35 info: Received shutdown notice from 'websrv01.elvisaltherr.ch'.
heartbeat: 2005/01/15_21:11:35 info: Resources being acquired from websrv01.elvisaltherr.ch.
heartbeat: 2005/01/15_21:11:35 info: acquire local HA resources (standby).
heartbeat: 2005/01/15_21:11:35 info: Acquiring resource group: anita.elvisaltherr.ch 10.0.0.3 apache
heartbeat: 2005/01/15_21:11:35 info: Local Resource acquisition completed.
heartbeat: 2005/01/15_21:11:35 info: Running /etc/ha.d/resource.d/apache start
heartbeat: 2005/01/15_21:11:36 info: local HA resource acquisition completed (standby).
heartbeat: 2005/01/15_21:11:36 info: Standby resource acquisition done [foreign].
heartbeat: 2005/01/15_21:11:36 info: Running /etc/ha.d/rc.d/status status
heartbeat: 2005/01/15_21:11:36 info: /usr/lib/heartbeat/mach_down: nice_failback: foreign resources acquired
heartbeat: 2005/01/15_21:11:36 info: mach_down takeover complete.
heartbeat: 2005/01/15_21:11:36 info: mach_down takeover complete for node websrv01.elvisaltherr.ch.
heartbeat: 2005/01/15_21:12:06 WARN: node websrv01.elvisaltherr.ch: is dead
heartbeat: 2005/01/15_21:12:06 info: Dead node websrv01.elvisaltherr.ch gave up resources.
heartbeat: 2005/01/15_21:12:06 info: Link websrv01.elvisaltherr.ch:eth1 dead.
heartbeat: 2005/01/15_21:12:06 info: Link websrv01.elvisaltherr.ch:/dev/ttyS1 dead.
heartbeat: 2005/01/15_21:12:31 WARN: TTY write timeout on [/dev/ttyS1] (no connection or bad cable? [see documentation])
heartbeat: 2005/01/15_21:10:10 info: No pkts missing from websrv01.elvisaltherr.ch!
heartbeat: 2005/01/15_21:10:10 info: Other node completed standby takeover of foreign resources.
heartbeat: 2005/01/15_21:11:35 info: Received shutdown notice from 'websrv01.elvisaltherr.ch'.
heartbeat: 2005/01/15_21:11:35 info: Resources being acquired from websrv01.elvisaltherr.ch.
heartbeat: 2005/01/15_21:11:35 info: acquire local HA resources (standby).
------------------------------------------------------------


many thanks for your help


 
Hi all

no i solved the problem

it was a little bit tricky, but now i know how the cluster works

 
Can you elaborate on your solution? That is the reason for these forums.

Thanks
 
yes of course

if you want to build a cluster with apache you need configure apache to listen also on the Clusters IP Adress.... and you need also 2 A Records in the DNS

and for mysql you need to configure the mysqld daemon to listen also to the Clusters IP instead of localhost


thats all and now it works fine


see configuration below apache:


------------------------------------------------------------


login as: root
root@192.168.1.114's password:
Access denied
root@192.168.1.114's password:
Last login: Tue Jan 18 01:19:31 2005 from 213.200.242.188
[root@websrv01 root]# cd /usr/local/apache2/conf/
[root@websrv01 conf]# vi httpd.conf
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80
Listen 80
Listen 10.0.0.3:80 ---> IP Adress of Cluster
#Listen 213.200.242.190:80
#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd -l') do not need
-- INSERT --

-----------------------------------------------------------

and for mysql:
-----------------------------------------------------------

login as: root
Password:
Last login: Tue Jan 18 01:15:29 2005 from websrv01.elvisaltherr.ch
anita root # cd /etc/mysql/
anita mysql # ls
my.cnf mysqlaccess.conf
anita mysql # vi my.cnf
# lets use last number from IP address
# server-id = 207
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/english
skip-locking
set-variable = key_buffer=16M
set-variable = max_allowed_packet=1M
set-variable = thread_stack=128K
# keep secure by default!
bind-address = 10.0.0.3 --> Cluster IP
port = 3306
# this can make it even more secure:
#skip-networking

[mysqldump]
quick
set-variable = max_allowed_packet=1M

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition

"my.cnf" 82L, 2816C 69,1 96%
------------------------------------------------------------


hope this helps


 
What heartbeat package did you use for your installation?

Thanks
 
I hate to sound like an idiot, but does anybody have a link to the heartbeat webpage? I've searched, but I can't seem to find out. I've found individual questions on various mailing lists, but nothing pointing to a site for heartbeat. Thanks.

----------------------------
"Will work for bandwidth" - Thinkgeek T-shirt
 
Thankies.

----------------------------
"Will work for bandwidth" - Thinkgeek T-shirt
 
Hi all

i used the newest 1.2.3 Version (which is recommended in case of security fixes)

it works fine, but the configuration was (as i described above) a little bit tricky

Note: on Gentoo Linux emerge heartbeat does the job
and it works there also fine
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top