Keepalived with nginx open source
francis at daoine.org
Fri May 27 09:56:26 UTC 2022
On Wed, May 25, 2022 at 01:34:03PM -0400, blason wrote:
> I am going to deploy two nginx reverse proxy servers and I wanted them in HA
> mode. I see keepalived is available with Plus version however keepalived
> being an open source can be used with Open source version as well? Can
> someone please confirm if keepalived or any other approach can help me in
> achieving Active-Passive setup of nginx reverse proxies?
As per the other reply -- it should Just Work.
The way keepalived works is that IP#1 is on machine1, IP#2 is on machine2,
and IP#3 is on one of those two machines -- it changes or "floats"
between them, based on the keepalived configuration.
So for high-availability, you want your clients to talk to IP#3 (and be
handled by whichever machine currently has that IP).
>From an nginx config point of view, the main thing is probably to ensure
that in your "listen" directives, you don't do anything that would cause
nginx to try to bind() to IP#3.
(At least one of those bind() attempts should fail because IP#3 is not
on that machine right now, which would lead to sadness.)
If you want to see whether your config avoids that -- try running it
on a machine that does not have IP#3. If nginx fails to start, you
probably want to look at your listen directives to see if you are happy
to change them.
Good luck with it,
Francis Daly francis at daoine.org
More information about the nginx