On Mon, Sep 08, 2008 at 12:22:33PM +0200, Marc Gràcia Galobart wrote:
> I have two mirrored groups of servers that serve images. Those two
> groups, are load balanced.
> Inside each group, there are a number of servers, each one having
> part of the images to serve. One of them has a reverse proxy
> that sends the image requests from the users to the appropriate
> server using a simple regexp match.
> The thing is that if one of those server inside a group fails, all
> the group have to be turned off, so the load balancer can detect
> the failure and use only the other group of the mirror.
> So what I need exactly, is to bring the reverse proxy down if one
> of the machines of the group is down. It's kind of a reverse ha.
> The reverse proxy service is up if and only if all the machines of
> the group are up, if not, bring it down.
> Can this be achieved using heartbeat2?

The lack of replies suggests that heartbeat probably isn't the most
suitable hammer for driving this particular nail. You might be able
to get it to work, but you'd probably hurt your fingers in the
process.

I would suggest setting up a simple network monitoring system on
your reverse proxy in each group, which periodically sends requests
to each of the member web servers. If any of those fails, then it
shuts down the proxy, or overwrites /vmlinuz with a few K from
/dev/random before rebooting the server, or does something else that
will get the load balancer's attention.

If you really want to use heartbeat... well, it'd be tricky. Where
it's ideally suited would actually be on the two reverse proxy
nodes, using a couple of monitor actions which do test fetches for
resources on each of the servers, and cause the service to be failed
if any of those fail. However, you already have a reasonably
intelligent load balancer so this would be of absolutely no benefit
to you.

On the servers themselves... you could make a cluster and add a
cloned resource which runs exactly one instance of your web server
on each member.  Assuming the resource script works properly, the
cluster would then be aware of a) any host being down and b) any
particular instance of the service being down or nonfunctional.

Then you could add a resource for the reverse proxy service,
constrained to only run on the particular node that serves that
function. Finally, you'd need a rule to prevent it from running
unless all N server resources are running. This is the part where I
run out of steam, as I have no idea how you'd make that rule.
Maybe one of the gurus on this list would have an idea. As an evil
hack job, you could parse the output of crm_mon -1 and stop the
proxy if there's anything amiss.

I think it might be doable but it's probably not worth the effort to
implement using heartbeat, unless you're wanting to have heartbeat
automatically reboot nodes via a STONITH device or similar.
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to