I have a Redis cluster of 3 master nodes and each master has corresponding slave nodes. I would like to acquire a lock on the cluster to perform some write operations and then release the lock.
From what I've read is - To connect to a cluster we generally connect to one node in the cluster and perform all operations on that node which in-turn handles re-directing to other nodes in the cluster.
Is it possible to acquire lock on a Redis cluster? [P.S I am using Redisson client] From the examples in Redisson client under Multilock and redlock (https://github.com/redisson/redisson/wiki/8.-Distributed-locks-and-synchronizers), they are acquiring a lock on individual nodes.
- How does Multi lock or Red lock work on a cluster?
- How and what kind of lock do I use if I have a Redis cluster?
- Which library (Jedis/Redisson) do I use?
Jedis also seems to have support for locking on the cluster (https://github.com/kaidul/jedis-lock).
P.S: I've read extensively on this, but I've not been able to find clear answers on locking on a cluster. Would really appreciate some help.