-
Notifications
You must be signed in to change notification settings - Fork 96
activity cache replication
David edited this page Aug 20, 2015
·
4 revisions
If there is a communications fault for the master redis instance, normally activity-cache0, haproxy will automatically start using the slave, activity-cache1. However when the redis master re-joins the cluster haproxy does not switch back to the master.
This procedure should reset the slave-master setup to normal, activity-cache0=master (now called 0) and activity-cache1=slave (now called 1).
Obviously check the for the private IPs of activity-cache{0,1} in case they've changed for some reason.
- first swap master/slave relationship;
redis-cli slaveof no one
redis-cli slaveof 10.224.14.104 6379
redis-cli sync
- wait until replication is normalized
redis-cli info | grep master_
- swap master/slave back again
redis-cli slaveof no one
redis-cli slaveof 10.224.14.103 6379
redis-cli sync
- reload haproxy
oldpid=$(ps -A | awk '/redis/ { print $1 }')
service haproxy reload
kill $oldpid
Checking the activity cache is easy, log in and upload a doc and it should appear in your activity stream.