I am looking for some help with figuring out a way to take a Redis Docker image and then do near real time replication of the data to another server maybe over an SSH tunnnel.

I need this to be able to go onto a Ubuntu 16.04 LTS VM/docker host, reason for this is OS limit is that the Redis Docker container is only a small part of our setup/application and the other major parts are not tested on anything else.

I was doing some reading and Redis itself has replication, but I am not sure if this is the best way to go about doing it.

We do have an SSH tunnel set up for another database sync.

How could I do this properly? The whole point/idea of this is that we need a DR plan and this factors into it.

My best idea so far has been a rsync between the two servers I need the data on, though I know that is not a good solution and want something a bit better.


You don't mention orchestration, are you planning to implement all by your own configuration on top of Ubuntu?

I recommend you that take a look at Kubernetes and StatefulSet workloads


You can use Ubuntu as your host to accomplish your needs, but in my experience, you can only need to define correctly your workload and open the right ports to communicate and with the kubernetes integration on different providers you have the persistent volume easy to manage.

Also, I recommend you to review Helm and you have a redis-ha chart ready


| improve this answer | |

Typically people put their container volumes in something like S3 to replicate data. The typical strategy for disaster recovery would be to

  1. Have a means to snapshot the data in the volume
  2. Define endpoints where those snapshots can be stored, as backing services
  3. Pull in the latest version of the snapshot as part of the application startup

For shared state, you should use the built-in replication functionality of the application, where it exists, i.e. https://redis.io/topics/replication

| improve this answer | |
  • I have proposed S3 to the others and got told we are looking for something more real time and the idea of using an existing SSH tunnel might be worth it. The plan has changed a bit from the OP (I will edit after this comment) but we now are not looking at copying the volumes but instead the actual data as it comes in. – user8517 Nov 2 '18 at 11:46

I was doing some reading and Redis itself has replication, but I am not sure if this is the best way to go about doing it.

Yes, using redis' built-in replication is going to be vastly safer and more real-time than a home-grown solution. Use it.

You may also be interested in sentinel for switching automatically over to the replica during an outage.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy