redisSlaveOf: redisSlaveOf

Description Usage Arguments Details Value Author(s) References

View source: R/controlCMD.R

Description

Change Redis replication settings.

Usage

1
redisSlaveOf(host, port)

Arguments

host

The host name of a master Redis server.

port

The port of a master Redis server.

Details

(The following details are adapted from the Redis Wiki manual referenced below.)

The redisSlaveOf command can change the replication settings of a slave on the fly. If a Redis server is arleady acting as slave, the function redisSlaveOf(host="no",port="one") will turn off the replicaiton turning the Redis server into a MASTER. In the proper form redisSlaveOf(hostname,port) will make the server a slave of the specific server listening at the specified hostname and port.

If a server is already a slave of some master, redisSlaveOf(hostname,port )will stop the replication against the old server and start the synchrnonization against the new one discarding the old dataset.

The form redisSlaveOf(host="no",port="one") will stop replication, turning the server into a MASTER but will not discard the replication. So if the old master stop working it is possible to turn the slave into a master and set the application to use the new master in read/write. Later when the other Redis server will be fixed it can be configured in order to work as slave.

Value

A Redis status message is returned.

Author(s)

B. W. Lewis

References

http://redis.io/commands


rredis documentation built on May 2, 2019, 2:02 p.m.