Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is is possible to Create a Redis Cluster with 2 Replicas #185

Closed
d80tb7 opened this issue Dec 9, 2021 · 7 comments · Fixed by #408
Closed

Is is possible to Create a Redis Cluster with 2 Replicas #185

d80tb7 opened this issue Dec 9, 2021 · 7 comments · Fixed by #408
Labels
enhancement New feature or request

Comments

@d80tb7
Copy link

d80tb7 commented Dec 9, 2021

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

@d80tb7 d80tb7 added the enhancement New feature or request label Dec 9, 2021
@davidcollom
Copy link
Contributor

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?

@apena-pmy
Copy link

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

@davidcollom
Copy link
Contributor

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.

@bkrugerp99
Copy link

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.

@plachta11b
Copy link

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.

@emahdij
Copy link

emahdij commented Jan 12, 2023

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?

@shubham-cmyk
Copy link
Member

#417

@iamabhishek-dubey iamabhishek-dubey linked a pull request Feb 13, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants