Redis peer-to-peer like cluster(K8s)

3/22/2018

I want a redis cluster that every redis instance can access other instance's data i.e data should be replicated among themselves.(With out master-slave concept)

I'm trying to setup redis RepilcaSet in K8s. I tried to setup slave-read-only no in config which pods are restating continuously.

Update1

I used https://github.com/kubernetes/examples/tree/master/staging/storage/redis example to setup cluster which is master-salve+Redis Sentinel. But my application can't access sentinel to know who is the redis master. That's why I don's want to use sentinel.

-- Veerendra Kakumanu
kubernetes
redis

2 Answers

5/31/2018

You can have master and slave in same node if you are short of nodes.

Replication in Redis uses the master - slave concept. you can't replicate by switching off slave. https://redis.io/topics/replication

enter image description here

-- Srini Sydney
Source: StackOverflow

5/31/2018

If you do mutual replication, you need to have a way to resolve 'both updated' situations and it is not that easy. You need either CRDT model or a good resolver algorithm. If you just cycle the dependency (idk if it is possible), simultaneous updates on multiple nodes will propagate unpredictably.

Take a look at SoundCloud's roshi. Maybe it will be enough for your case?

-- Imaskar
Source: StackOverflow