1

I'm configuring a new set of servers for an existing Wordpress site, and it's been requested that memcache be available and made more resilient. The idea proposed is to have HAProxy send requests to one of the two servers; if that memcache instance is inaccessible, then it should switch to the second, but should not switch back to the first if it comes back up unless the second is then unavailable.

This doesn't appear to be a particularly common use case and I've not found much along these lines except to possibly set up the first node with an enormous rise value, such as:

server server1 10.112.58.16:11211  check inter 5s fall 3 rise 99999999
server server2 10.112.58.19:11211  check backup

which falls over as expected when server1 is unavailable. It won't ever fall back to server1, though, even if server2 goes offline. Can this be made to work?

1

Keepalived or pacemaker sounds like a more appropriate solution for your use case. Using just haproxy leaves you with a single point of failure and no way to prevent automatic failback in the manner you want, whereas Keepalived or pacemaker will do exactly you need without a single point of failure.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.