Redis - Server Slaveof Command


Redis SLAVEOF command can change the replication settings of a slave on the fly. If a Redis server is already acting as a slave, the command SLAVEOF NO ONE will turn off the replication, turning the Redis server into a MASTER. In the proper form SLAVEOF hostname port will make the server a slave of another server listening at the specified hostname and port. If a server is already a slave of some master, SLAVEOF hostname port will stop the replication against the old server and start the synchronization against the new one, discarding the old dataset.

Return Value

Simple string reply.


Following is the basic syntax of Redis SLAVEOF command.

redis> SLAVEOF host port