content/commands/cluster-replicate.md
The command reconfigures a node as a replica of the specified master. If the node receiving the command is an empty master, as a side effect of the command, the node role is changed from master to replica.
Once a node is turned into the replica of another master node, there is no need to inform the other cluster nodes about the change: heartbeat packets exchanged between nodes will propagate the new configuration automatically.
A replica will always accept the command, assuming that:
If the node receiving the command is not already a replica, but is a master, the command will only succeed, and the node will be converted into a replica, only if the following additional conditions are met:
If the command succeeds the new replica will immediately try to contact its master in order to replicate from it.
| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Not supported">❌ Standard</span> <span title="Not supported"><nobr>❌ Active-Active</nobr></span> | <span title="Not supported">❌ Standard</span> <span title="Not supported"><nobr>❌ Active-Active</nobr></span> | |
{{< multitabs id="cluster-replicate-return-info" tab1="RESP2" tab2="RESP3" >}}
Simple string reply: OK if the command was successful. Otherwise an error is returned.
-tab-sep-
Simple string reply: OK if the command was successful. Otherwise an error is returned.
{{< /multitabs >}}