Setting up Keepalived

tested on slackware current (oct 2021) and debian12

Install

see install

Setup

cp -pi /etc/default/keepalived /etc/default/keepalived.dist
    vi /etc/default/keepalived

# buster
#DAEMON_ARGS="...

    KEEPALIVED_OPTIONS="--vrrp --log-detail"
    # --enable-log-file --log-file=/var/log/keepalived.log

see ha for tracking system applications e.g. squid or nginx.

see routing for states' fail-over.

Ready to go

check the configuration and populate across the cluster

slackware

slack1

    keepalived -t
    /etc/rc.d/rc.keepalived restart

debian

keepalived -t
systemctl restart keepalived.service

Maintenance

start

    ls -lF /etc/rc.d/rc.keepalived # already enabled
    /etc/rc.d/rc.keepalived start

and enable at boot-time

    vi /etc/rc.d/rc.local

    # self-verbose
    sysctl net.ipv4.ip_nonlocal_bind=1
    /etc/rc.d/rc.keepalived start

status

    pgrep -a keepalived
    ps auxfw | grep keepalived

reload

    /etc/rc.d/rc.keepalived reload

restart (donno why restart itself doesn’t work)

    /etc/rc.d/rc.keepalived stop
    /etc/rc.d/rc.keepalived start

Resources

manuals

keepalived.conf - configuration file for Keepalived https://www.keepalived.org/manpage.html

keepalived.conf - configuration file for Keepalived https://fossies.org/linux/keepalived/doc/man/man5/keepalived.conf.5

https://manpages.debian.org/bookworm/keepalived/keepalived.conf.5.en.html

guides

16.5 Installing and Configuring Keepalived https://docs.oracle.com/cd/E37670_01/E41138/html/section_ksr_psb_nr.html

16.5.1 About the Keepalived Configuration File https://docs.oracle.com/cd/E37670_01/E41138/html/section_wv3_hjn_pr.html

16.6 Configuring Simple Virtual IP Address Failover Using Keepalived https://docs.oracle.com/cd/E37670_01/E41138/html/section_uxg_lzh_nr.html

16.10 Making HAProxy Highly Available Using Keepalived https://docs.oracle.com/cd/E37670_01/E41138/html/section_sm3_svy_4r.html

Keepalived and high availability: Advanced topics https://www.redhat.com/sysadmin/advanced-keepalived

Deploying Highly Available Virtual Interfaces With Keepalived https://prefetch.net/articles/linuxkeepalivedvrrp.html

https://www.linode.com/docs/products/compute/compute-instances/guides/failover-legacy-keepalived/ ==> nice MWE

ops

Keepalived and Virtual IP: The friends are not always helping! https://www.linkedin.com/pulse/keepalived-virtual-ip-friends-always-helping-angelo-giannattasio/

Setting up a Linux cluster with Keepalived: Basic configuration https://www.redhat.com/sysadmin/keepalived-basics

View Current State of Keepalived https://serverfault.com/questions/560024/view-current-state-of-keepalived

acceptance

https://www.virtualtothecore.com/manual-failover-of-keepalived/ ==> trigger the fail-over by other means

some theory

https://www.redhat.com/sysadmin/ha-cluster-linux ==> VRRP descr

troubles

Keepalived’s virtual_router_id - should it be unique per node? https://serverfault.com/questions/473058/keepaliveds-virtual-router-id-should-it-be-unique-per-node

keepalived: create keepalived_script system user/group #224 https://github.com/hap-wi/roxy-wi/issues/224

moar

Adoption https://wiki.nftables.org/wiki-nftables/index.php/Adoption

nftables support #924 https://github.com/acassen/keepalived/issues/924

netfilter

Re: nftable rule for VRRP traffic https://www.spinics.net/lists/netfilter/msg59869.html

alternatives

https://help.mikrotik.com/docs/display/ROS/VRRP

carp


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun