Sunday, November 13, 2016

VRRP with Keepalived

First, the website for keepalived:

http://www.keepalived.org/

Originally, I read the documentation on their website, which is dated June 13th, 2002.

http://www.keepalived.org/pdf/UserGuide.pdf

Unable to believe that the documentation could not be changed after this many years, I went digging for better more updated documentation, and indeed, I found that here:

https://media.readthedocs.org/pdf/keepalived/latest/keepalived.pdf

WHY DOES THIS NOT LIVE ON THE WEBSITE????

I started reading. This is not simple / trivial.

Keepalived is essentially used mainly for load balancing, and when you read up on it, it is inferred that one needs to have LVS (Linux Virtual Server). There are quite a number of sites discussing how to build a Load Balanced with LVS, like this one below.

http://www.linux-admins.net/2013/01/building-load-balancer-with-lvs-linux.html

But there did (and still does not) seem to be much documentation discussing what you need to do, exactly, to install and run LVS. For instances, does it come by default on systems? Do you need to install it? Compile it?

One article, albeit from 2004, scared me when I started reading about patching the kernel to use it.

http://www.ultramonkey.org/papers/lvs_tutorial/html/

Later, I found this link, which, FINALLY, makes it clear that you need the package ipvsadm (on CentOS, which is the OS I am interested in).

NOTE: Maybe these are different services and packages on other Linux distributions.

https://www.server-world.info/en/note?os=CentOS_7&p=lvs

Next, I started reading further, and realized that, in order to use VRRP, you don't even need to use LVS!!! WHY? Because VRRP is only used to maintain state between Master and Slaves on Load Balancers, so that a) someone is always on top of the load balancing task and b) the Load Balancers know who the master is, and who the slave is. It is also used to prevent Split-Brain mode (multiple masters, etc).

So - why would you be interested in VRRP, without the Load Balancing? That does not seem to make much sense? And that is why these concepts are so intertwined. But in our case, admittedly a rare one, that is our requirement. We just want VRRP for the purpose of making sure a node is always up; we don't need the nodes running VRRP to load balance anything behind them.

So I found these sites below that, rather than address LVS (and using KeepaliveD for LVS and Load Balancing), and instead focus on the VRRP aspects of KeepaliveD.

https://tobrunet.ch/2013/07/keepalived-check-and-notify-scripts/

http://packetpushers.net/vrrp-linux-using-keepalived-2/

This site from Oracle helps provide some guidance on the tracking features of keepalived (scripts, interfaces, et al). It finally explained what interface tracking is for / does.

https://docs.oracle.com/cd/E37670_01/E41138/html/section_hxz_zdw_pr.html



No comments:

Fixing Clustering and Disk Issues on an N+1 Morpheus CMP Cluster

I had performed an upgrade on Morpheus which I thought was fairly successful. I had some issues doing this upgrade on CentOS 7 because it wa...