How To Set Up a Redis Slave
-
So you have a new Redis server installed and you want to make it a slave of another node. This is a very common Redis task but the Redis documentation is terrible, even for the easiest stuff. Once your new Redis server is up and running it is as easy as this (assuming that 10.10.10.2 is the IP address of the current Redis master and that it is listening on the default Redis port of 6379)....
On the "to be" slave
redis-cli slaveof 10.10.10.2 6379
And that is it. The system should slave itself to the selected master and begin syncing up immediately. You can view the status of this process with...
redis-cli info
Specifically you can see if the role has taken:
redis-cli info | grep role
This should be "role:slave" if it was successful. And now let's see if it successfully could see the master:
redis-cli info | grep master_link_status