redis-operator
redis-operator copied to clipboard
Is is possible to Create a Redis Cluster with 2 Replicas
Hello,
I was trying to use the operator to have 2 followers per leader, i.e. a replication factor of 2, but couldn't find a way to achieve this. Is this possible with the operator?
many thanks,
Chris
I don't think this is possible within the current structure, do you have any thoughts on an API in terms of how your resource would look?
Something that comes to mind for myself was something like:
apiVersion: redis.redis.opstreelabs.in/v1beta1
kind: RedisCluster
metadata:
name: redis-cluster
spec:
redisLeader:
size: 1
redisFollower:
replicationFactor: 2
Resulting in 1 Leader and 2 Followers, Increasing Leaders to 3 (for N+1) would result in 6 Leaders, where Leader%Follower would be used to determine the Leader in which the Follower would replicate from?
I think just specifying the number of followers replicationFactor would be enough and keep using clusterSize to deploy the desired amount of leaders. Maybe something like this:
apiVersion: redis.redis.opstreelabs.in/v1beta1
kind: RedisCluster
metadata:
name: redis-cluster
spec:
clusterSize: 3 # Desired amount of leaders
redisFollower:
replicationFactor: 2 # Followers per leader
Could this be posible ?
Thanks
I did initially think of something very similar and could work.
Something I did see as a possible issue was that right now there's a 1:1 on leader/follower, adding a factoring, there would have to be some kind of calculation to work out follower to leader.
Happy to look into this though, I've just not had much time to think about it in depth since initial response.
This looks good. I'm going to request that you can go single leader and multiple replicas so you can have just HA and not the additional sharding that comes with adding multiple leaders.
Look for Redis Sentinel if you need Redis HA solution without sharding.
This looks good. I'm going to request that you can go single leader and multiple replicas so you can have just HA and not the additional sharding that comes with adding multiple leaders.
Hi Based on this video I want to deploy 3 masters with 2 replicas to prevent split brain. Now is there any way to increase the replica to 2?
https://github.com/OT-CONTAINER-KIT/redis-operator/pull/417