Hi,
I'm working on running 2 redis nodes as failover cluster.
Keepalived migrating VirtualIP successfully, but still not clear how to run command on slave to be a master during failover.
Here is a config:
Code:
! Configuration File for keepalived
global_defs {
notification_email {
root@example.com
}
notification_email_from redis1_keepalived@example.com
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id keepalived_on_redis
}
vrrp_script chk_redis {
script "kill -0 `cat /var/run/redis.pid`"
interval 2
}
vrrp_instance VI_1 {
state MASTER
interface bond0
virtual_router_id 10
priority 101
advert_int 1
authentication {
auth_type PASS
auth_pass 12345678
}
virtual_ipaddress {
1.2.3.4 label bond0:0
}
track_script {
chk_redis
}
notify_fault "redis-server /etc/redis.conf; redis-cli slaveof no one"
}
Please advice how to configure master/slave to run redis-cli command properly on failover and then restore slave status on restoring master. Thanks!