Redis active - active replication across datacenters / Kubernetes clusters

6/28/2018

I have deployed a highly available Redis service on Kubernetes (the redis version used is 4.0.9) with aof persistence. Three sentinel nodes monitoring one master node and two slave nodes. I now have the following use case: Deploy two instances of the kind described above on separate Kubernetes clusters and keep them in sync. The setup should provide active - active replication.

The possible solutions I have come up with until now are:

  1. using Twitter's twemproxy to proxy requests to and from the separate Redis services in the Kubernetes. The issue in this case is that (afaik) twemproxy automatically shards data across the available Redis nodes / clusters, hence the master redis nodes in the configuration described above will not have the same data-sets at any given point in time.
  2. Using XDCRWithKafka. I haven't managed to find any documentation on the use of XDCRWithKafka...
  3. Using HAProxy in pretty much the same way twemproxy would be used (again, afaik,HAProxy does not support request multicasting)
  4. Some custom sln of the sort described in: http://grokbase.com/t/gg/redis-db/123nyg4rfp/multiple-master-going-to-one-slave (although keeping the redis clusters in sync with such a solution while in active - active state does not seem to be that straightforward...)

Any ideas / suggestions?

Thanks in advance, George

-- user10004767
kubernetes
redis
replication
twemproxy
xdcr

1 Answer

1/28/2019

As far as i have seen, only Dynomite seems to solve this problem. https://github.com/Netflix/dynomite/wiki/Topology

Else one suggestion is to implement our own by having a setup something like this:

DataCenter1:

[multiple redis clients]===>[localProxy-DC1]====> TWEMPROXY-DC1 ===> [Multiple Redis Single Instances with Sentinel]

DataCenter-2:

[localProxy-DC1] ====replicates commands async===> TWEMPROXY-DC2 ====> [Multiple Redis Single Instances with Sentinel]

-- summasumma
Source: StackOverflow