Skip to content

Instantly share code, notes, and snippets.

View jirutka's full-sized avatar
🇺🇦
Слава Україні!

Jakub Jirutka jirutka

🇺🇦
Слава Україні!
View GitHub Profile
@jirutka
jirutka / README.md
Last active June 3, 2024 12:16
Simple Keepalived notify script for Valkey/Redis master-replica failover

This is a simple solution for when you use keepalived with VRRP to failover between two instances of an application (e.g. nginx) that uses Redis/Valkey.

It doesn’t provide a high guarantee of data consistency, so it’s only suitable for caches, user sessions and similar!

keepalived.conf example:

vrrp_instance vi {
    ...
    notify "/etc/keepalived/scripts/notify_valkey.sh"
}