Link Is Not Keepalived
The goal of this project is to provide a simple and easy way to manage virtual IPs. This project aims to be as KISS and dynamic as possible.
- KISS our goal is not to rebuild Keepalived nor Pacemaker
- If an IP is configured on a server there must always be at least one server that binds the IP
To add an interface LinK will add the IP to the configured interface and sent a unsolicited ARP request on the network (see Gratuitous ARP).
This is the equivalent of:
ip addr add MY_IP dev MY_INTERFACE
arping -B -S MY_IP -I MY_INTERFACE
To unbind an IP we will just remove it from the interface.
This is the equivalent of:
ip addr del MY_IP dev MY_INTERFACE
Each IP can be in any of these three states:
ACTIVATED
: This machine owns the IPSTANDBY
: This machine does not own the IP bust is available for electionFAILING
: Health checks for this IP failed, this machine is not available for election
At any point three types of events can happen:
fault
: There was some error when coordinating with other noteselected
: This machine was elected to own the IPdemoted
: This machine just loosed ownership on the IPhealth_check_fail
: The health checks configured with this IP has failed.health_check_success
: The health checks configured with this IP has succeeded.
This is what the state machine looks like:
GET /ips
: List all currently configured IPsPOST /ips
: Add an IPGET /ips/:id
: Get a single IPDELETE /ips/:id
: Remove an IPPOST /ips/:id/lock
: Force a link to try to get this IP
To make it work in dev you might want to add a dummy interface:
modprobe dummy
ip link add eth10 type dummy
ip link set eth10 up
ip link add eth11 type dummy
ip link set eth11 up
ip link add eth12 type dummy
ip link set eth12 up
The script start.sh
can be executed as root to automatically do that.