Setting up a disaster recovery cluster involves two parts: enabling disaster recovery configuration for the Redis instance and establishing a connection between the target instance and the source instance.
In a disaster recovery cluster, the role of each Redis instance is not fixed; it can be either a source or a target. The target does not restrict data writing, but data written to the target will be overwritten by data synchronized from the source or cause synchronization failure due to data type conflicts.
You need to create a Redis instance first.
After enabling disaster recovery support for the instance, the disaster recovery Proxy provides a NodePort access address by default. A single NodePort-based access address is not highly available. In a production environment, you can use a LoadBalancer address to provide access to the Proxy.
Each disaster recovery instance will create a Proxy Service with a name that follows this format: activeredis-proxy-<instance-name>
.
For Sentinel instances, the instance name needs to be prefixed with
rfr-
The range of serviceID
is [0-15]
. In the same disaster recovery cluster, the serviceID cannot be repeated.
default
userNote to replace the source address and secret.
Here status.shards[0].status
indicates the connection status of the shard, and status.shards[0].syncStatus
indicates the data synchronization status. The synchronization status can be PartialSync
(indicating incremental synchronization of Oplog) or FullSync
(indicating that RDB is being synchronized).
The native Redis Sentinel mode does not have the concept of shards. Here, a master-slave of Sentinel is abstracted as
shard 0
to be compatible with the same data structure as the Redis cluster mode.