master server down - lvs cluster default to emergency server
Alois Treindl
alois at astro.ch
Sat May 22 14:52:04 UTC 2004
Hello
I have a small question:
My LVS NAT cluster consists of several http servers, and one mysql
database server.
I understand that I can configure piranha via lvs.cf to make healt
checks on the httpd service as well as on the mysql server
Now, if the database server is down, all web servers become
dysfunctional, as they cannot provide application data anymore.
I need to announce to all web users a 'server down' page.
I do this by directing all http/https requests to an emergency server.
It's apache server is configured to show the same emergence page for any
URL it receives. The emergency apache server runs on the router/director
itself.
How con I configure piranha lvs.cf in such a way, that, if the mysql
health check fails, it redirects all http and https request coming into
the LVS to the emergyency http server?
My healty ipvs configuration looks like this:
${IPVSADM} -A -t $LVS:www -s wlc -p 60
${IPVSADM} -a -t $LVS:www -r w1:www -m -w 2000
${IPVSADM} -a -t $LVS:www -r w5:www -m -w 2000
${IPVSADM} -a -t $LVS:www -r w6:www -m -w 2000
${IPVSADM} -A -t $LVS:https -s wlc
${IPVSADM} -a -t $LVS:https -r w1:https -m -w 1000
my 'sick' configuration (with redirection to the emergency server)
looks like this:
${IPVSADM} -A -t $LVS:www -s rr
${IPVSADM} -a -t $LVS:www -r $WWC:www -m
${IPVSADM} -A -t $LVS:https -s rr
${IPVSADM} -a -t $LVS:https -r $WWC:www -m
where $WWC is the real (external) IP of the director/router
Can piranha do the switch to the 'emergency state'?
Piranha does not have to turn the servers back on automatically, when
the database service recovers. In my experience, often some manual work
is required on the dbms server, before the web service can be resumed.
Alois Treindl
Switzerland
More information about the Piranha-list
mailing list