Skip to content

Instantly share code, notes, and snippets.

@maurorappa
Created January 18, 2017 11:14
Show Gist options
  • Save maurorappa/c347aa8272a73975e29b98de01f0ee03 to your computer and use it in GitHub Desktop.
Save maurorappa/c347aa8272a73975e29b98de01f0ee03 to your computer and use it in GitHub Desktop.
Keepalived config with VIP bounded on Redis master
! Configuration File for keepalived
global_defs {
}
vrrp_script chk_redis_master {
script "redis-cli info replication|grep master > /dev/null"
interval 2 # check every 2 seconds
weight 2 # add 2 points of prio if OK
}
vrrp_instance VI_2 {
state BACKUP
interface eth1 # VRRP traffic will run on eth1 - management
virtual_router_id 53
priority 100
advert_int 1
unicast_src_ip 192.168.70.11
unicast_peer {
192.168.70.12
}
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
192.168.3.3 dev eth1 label eth1:1
}
track_script {
chk_redis_master
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment