Version
6.2.7
Overview
Hi team, currently we're running redis cluster on below three servers.
- hostname1
- hostname2
- hostname3
and each servers have 55 redis nodes, some are replica, some are master.
is it possible to force replica node to follow master node that is not hosted in the same server? I mean, when the one of the server is down and if, both master-replica are hosted in the broken server, it causes the shard loss.
Comment From: jhon-conner
Maybe this is what you are looking for: https://redis.io/docs/management/scaling/
see sections below: [Add a new node as a replica] section [Replica migration] section
Comment From: kubosuke
Thanks @jhon-conner , able to fulfill expected outcomes by:
- run https://redis.io/commands/cluster-replicas/
- remove/readd old-replica node
check script:
redis-cli -h `hostname` -p 7000 cluster nodes | grep master | awk '{print $1, $2}' | awk -F '[ :]' '{print $1, $2}' | while read -r id ip; do redis-cli -h `hostname` -p 7000 cluster replicas $id | grep $ip; done