Hi,
We are using redis-2.8.17 in our production servers. For each redis server(master) we maintain a slave for HA in the same data center(dc). So in case of any issues in the master redis server we have slave as back up and once the slave takes over(as master) either the old master will be rejoined as slave or a new server is provisioned as slave. This way we are ensuring the HA of redis servers inside the dc.
In our infrastructure we have a stand by DC for unforeseen disasters in the primary DC. In case of any disasters or issues in the primary DC, we need to open up the secondary DC without any delay. So our requirement is to maintain a upto date copy of the redis data at the secondary DC from primary DC. Once the secondary DC takes over(as main DC), the primary DC should be upto date with the secondary DC.
*********************It will be helpful if someone can through some lights on the flawless possible ways to achieve our above requirement and how other redis users are doing the inter-dc replication *********************************
We were able to configure replication between primary DC and secondary DC. But this replication comes with its own cost. As the psync is used by redis internally for only a limited cases, for all other cases a full sync has to be performed and there by lot of data transfer across the network. We also increased "repl-backlog-size, repl-backlog-ttl, repl-timeout, client-output-buffer-limit" redis parameters to reduce the full sync cases. But still it doesn't looks like a fool proof solution.
Also after making the secondary DC as main DC, we are forced to configure a full sync(as there is no binlog position kind of thing in redis as like mysql) from secondary DC to primary DC(again a lot of data transfer across the network, which might saturate the network bandwidth). This is because we have 'n' number of redis servers with ~20GB of data in each.
To avoid the challenges in redis full sync, we had an idea of capturing the modified/new keys from the client and an asynchronous thread fetching the values of these keys from one DC and writing it to the other DC. But we are not sure of the practical difficulties in implementing this solution and we would be grateful if someone can share the ideas on same.
In short : Both the data centers(whichever happens to be the main/stand by DC) should be in sync all the time, kindly help us on achieving this with a better solution.
-Sairam.