REPLICATION.FAILOVER
REPLICATION.FAILOVER
- Group
- Replication
- Complexity
- O(1)
- Arity
- 1 (exactly, counting the command name)
- Flags
- admin, slow
- HotKV Cloud
- Scale
- On-Premise
- requires the replication license feature
REPLICATION.FAILOVER promotes the receiving replica to primary: it stops
following its primary, keeps the data it has, starts accepting writes, and
accepts replicas of its own. Use it when the primary of a non-cluster
deployment is lost or being retired. Point your clients, and any other
replicas, at the new primary afterwards.
Writes the old primary accepted but had not yet sent to this replica are not on the new primary, so if the old primary is still up, stop writes to it (or let the replica catch up) first. In cluster mode, use CLUSTER FAILOVER instead.
Return value
Section titled “Return value”Simple string OK in RESP2 and RESP3, or one of these errors:
| Case | Error |
|---|---|
| Cluster mode is on | ERR In cluster mode use CLUSTER FAILOVER |
| The node is not a replica | ERR This node is not a replica |
| The node could not start as primary | ERR Replication could not start as primary, see the server log |
No license that includes replication |
NOLICENSE replication requires a HotKV license. Contact sales@hotkv.com |
Examples
Section titled “Examples”127.0.0.1:6380> REPLICATION.FAILOVEROK127.0.0.1:6379> REPLICATION.FAILOVER(error) ERR This node is not a replicaCompatibility
Section titled “Compatibility”HotKV-only command. The Redis FAILOVER command is accepted by HotKV only
for compatibility and replies with an error; REPLICAOF NO ONE also
promotes a replica.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.