Redis Master Slave on Rancher

In our initial endeavours to containerise our website using docker and rancher, we set globally established a redis container. This caused problems if a user was directed to a different server.

Now we have a single redis container operating on one host, and all web containers relying on that redis container, as follows:

docker-compose.yml:

redis:
  image: redis:2.8
  restart: always
  privileged: true
  expose:
    - 6379
  labels:
    io.rancher.scheduler.affinity: web

rancher-compose.yml:

redis:
  scale: 1

I was wondering if anyone has carried out a redis master-slave setup for hosts across a rancher environment and could give me some tips to get it going?

I read through the blog about redis clustering but it was not what I want to do.

Cheers

Hi Shawn,

I was wondering if you got the redis master-slave setup working in Rancher.
I would also like to do the same thing, but haven’t had much success.

Thanks

Hi @Alex,

I put this on the backlog of things to do, but haven’t gotten around to it yet. I was speaking with some people about it this last week and discussed possibly back engineering redis sentinel image to figure some way to do it. I found a helpful read here.

But I haven’t looked into it so much yet.

Hi All
If anyone has got the solution to setup redis master-slave in Rancher pls provide steps

thanks in advance

We have successfully setup a very stable redis sentinel cluster on rancher. It has been used for spring session persistence and tested several failover scenarios across several hosts.

Redis Sentinel: https://redis.io/topics/sentinel

I posted all the setup artifacts for everyone:

1 Like