Redis Cluster: New Node Initially Acts as Master Before Becoming Slave

12 Views Asked by At

I'm working with Redis Cluster and encountered something unexpected while adding a new node as a replica. I used the following command to add the node:

redis-cli --cluster add-node 127.0.0.1:7006 127.0.0.1:7000 --cluster-slave --cluster-master-id 3c3a0c74aae0b56170ccb03a76b60cfe7dc1912e

However, when I checked the cluster's nodes using the cluster nodes command, I observed that the newly added node initially appeared as a master and then, after some time, transitioned to a slave. This two-step process puzzled me, as I expected the node to be directly added as a slave, not first as a master then switching to a slave.

Can anyone explain why Redis Cluster adds a new node as a master initially, even when specifying it to be a slave? Is there a way to add a node directly as a slave, or is the initial master status an integral part of the Redis Cluster's node addition process?

This behavior seems to be by design, but I'm looking for a detailed explanation or any official documentation that clarifies this process.

0

There are 0 best solutions below