[Linux-HA] load balancing and failover in the same server
horms at verge.net.au
Mon Aug 22 02:12:31 MDT 2005
On Mon, Aug 22, 2005 at 03:38:59PM +0800, Hanny Tidore wrote:
> I have 2 servers: P1 and P2. Both runs heartbeat on RHEL 3.
> The application to be clustered consists of httpd and mysql. The
> objective is to have
> 1. httpd runs on both systems (P1 and P2). A virtual ip will "load
> balance" the traffic to the httpd.
> 2. The httpd will in turn access a mysql database. The database will
> run in "failover mode". That means mysql will be running in either P1
> or P2. MySql data will be stored in a shared disk.
> Is it possible to configure linux HA as above.
Yes, this should be possible, though I have to warn you that
having that much happening on 2 boxes is a bit tricky to set up,
especially if its your first time playing with this stuff.
For the httpd and loadbalancing stuff, you basically
want what I have explained at
For the mysql stuff, here is what I would do.
Add another VIP to your cluster, it can be in RFC1918 space
if you want, its just for local access to mysql. Have heartbeat
manage this VIP and mysql by adding them to your haresources file.
Have your applications access mysql using that VIP. Do not add
this second VIP to ldirectord's setup (or LVS in any other way),
and do not add it to local interfaces. Just let it be.
As for shared disk, this is not my area of expertise,
but drbd is a popular option which can be used in conjunction
More information about the Linux-HA