2 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN">
5 <link type=
"text/css" rel=
"stylesheet" href=
"style.css" />
12 <img style=
"border:none" alt=
"Redis Documentation" src=
"redis.png">
16 <div id=
"pagecontent">
18 <!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
19 <b>SlaveofCommand: Contents
</b><br> <a href=
"#SLAVEOF _host_ _port_">SLAVEOF _host_ _port_
</a><br> <a href=
"#SLAVEOF no one">SLAVEOF no one
</a><br> <a href=
"#Return value">Return value
</a>
22 <h1 class=
"wikiname">SlaveofCommand
</h1>
29 #sidebar
<a href=
"ControlCommandsSidebar.html">ControlCommandsSidebar
</a><h1><a name=
"SLAVEOF _host_ _port_">SLAVEOF _host_ _port_
</a></h1>
30 <h1><a name=
"SLAVEOF no one">SLAVEOF no one
</a></h1><blockquote>The SLAVEOF command can change the replication settings of a slave on the fly.If a Redis server is arleady acting as slave, the command
<code name=
"code" class=
"python">SLAVEOF NO ONE
</code>will turn off the replicaiton turning the Redis server into a MASTER.In the proper form
<code name=
"code" class=
"python">SLAVEOF hostname port
</code> will make the server a slave of thespecific server listening at the specified hostname and port.
</blockquote>
31 <blockquote>If a server is already a slave of some master,
<code name=
"code" class=
"python">SLAVEOF hostname port
</code> willstop the replication against the old server and start the synchrnonizationagainst the new one discarding the old dataset.
</blockquote>
32 <blockquote>The form
<code name=
"code" class=
"python">SLAVEOF no one
</code> will stop replication turning the server into aMASTER but will not discard the replication. So if the old master stop workingit is possible to turn the slave into a master and set the application touse the new master in read/write. Later when the other Redis server will befixed it can be configured in order to work as slave.
</blockquote>
33 <h2><a name=
"Return value">Return value
</a></h2><a href=
"ReplyTypes.html">Status code reply
</a>