0

Started learning RedisLabs Enterprise Cluster, but I confused on how to implement the High Availibility using RLEC. I understand that the RLEC using proprietary replication, which is different from the open source Redis. What I want to achieve is if my master db went down, my app still will able to function normally by connecting to the replica db.

My question are :

  1. I have already created 2 nodes. If I created a new Redis DB named testing with replication enabled, in which node is the master DB ( and which one is the slave )? Is the current master indicated by the endpoint?

nodes enter image description here

  1. I connected to localhost:19332 in each server( as displayed in endpoint ). Why I am able to do set from both server? (And it appears in both of the server). I thought usually the replication should be one way from master to slave?

enter image description here

Rudy
  • 7,008
  • 12
  • 50
  • 85

2 Answers2

2

I understand that the RLEC using proprietary replication, which is different from the open source Redis.

That's incorrect - replication in RLEC is identical to the open source's, it's the clustering that is different and proprietary.

What I want to achieve is if my master db went down, my app still will able to function normally by connecting to the replica db.

For databases with replication enabled, RLEC transparently manages failover for you - all you need to do is connect to the provided endpoint. In case of master failure, the system automatically fails over to the replica and all your application needs to do is retry connecting to the same endpoint in case of disconnects. The endpoint never changes and always leads to the current master.

  1. This information is available in the"Shards" view, or in rladmin via the status command. Regardless, the endpoint's location is not indicative of the master's - the endpoint is a proxy which connects your client to the master.

  2. This is how standard Redis replication works. In Redis, replication is one way, from master to slaves. However, slaves can be written to, but anything written to them won't make its way upstream and could be overwritten by data from the master. Regardless, always use the endpoint to connect to your database and never connect locally to the shards - this may lead to unexpected results.

Itamar Haber
  • 47,336
  • 7
  • 91
  • 117
2

I'll give you a few high level pointers, if you would like to get more info, please contact us at support@redislabs.com

For true HA your RLEC cluster should have at least 3 nodes, so you should add another node to your cluster. Once you create a Redis resource, you can configure it to be HA by simply enabling replication.

All you need is to connect your app to the endpoint provided in the UI. In case the node with the master Redis will go down, RLEC will automatically promote the slave and redirect your app requests to the new master.

Note, that you do need to configure DNS, and your cluster name must be a FQDN.

Regarding the redis-cli -p 19332 that works locally from both nodes, as my colleague @ItamarHaber mentioned, you are communicating with the Redis resource through a proxy, all requests are served by your master Redis process.

Ofir Luzon
  • 10,635
  • 3
  • 41
  • 52