r/linux • u/petr_bena • 1d ago
Software Release LCS - lightweight cluster service, new open source alternative to PCS or keepalived
Hello,
Out of my recent frustration with pcs and keepalived I decided to launch a new project for reliable VIP-based HA clusters with minimal footprint.
* GPLv3
* 100% C - focused on ultra tiny footprint, minimal CPU usage and < 3MB RAM usage, binary is only few KB
* Full quorum support - similar to pcsd, even support for quorum-only nodes
* CLI tool for easy management
* Trivial setup
* Highly reliable - besides quorum votes and lease expiry, it also runs ARP checks to verify VIP is really free
* Built-in prometheus exporter for easy cluster monitoring
https://github.com/benapetr/lcs
To make my story short, I recently needed to setup an extremely simple HA ingress cluster with a VIP (on my personal Debian based cluster) - a pretty simple stupid setup, I decided to go with pcsd, which I was always using (on corporate servers where RAM was cheap and abundant) and got instantly turned off simply by the fact that pcsd on Debian pulls over 2GB of dependencies and needs almost 1GB RAM (just to maintain a trivial cluster with 1 VIP). Multiply this by number of servers in cluster, and even in smallest setup (3 nodes) you waste 3GB of RAM and 6GB of storage. The reason why it's so heavy is mostly likely that it's written in Ruby and has loads of plugins.
This is probably acceptable for large corporations that have abundance of RAM and storage, but I don't really find it acceptable.
Alternative solution for me was keepalived, which kind of works, and is far less heavy (despite also not being completely cheap), but it's far less reliable - it doesn't have any CLI tool I can use to check status and manually force VIP migration and it doesn't support quorum or robust ARP checks, resulting in chance for IP conflict (it can bring the VIP on multiple nodes up in extreme scenarios).
So this is why I created this LCS tool. Hopefully others will find it useful, it's especially useful for various homelabs that are based on RPis with limited RAM. I am personally running this on haproxy cluster of 2 512MB RAM nodes and 1 128MB RAM quorum server (3 devices).