3

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.

1

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

  • 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. – Josh Kirby Nov 2 '18 at 11:46
0

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.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.