Source: adityaajoshi.medium.com

Setting Up Redis Cluster
In this article, we are going to set up the Redis cluster in docker based environment. We will start up by setting up the 3 redis instance with data replication enabled and after that, we will setting up 3 sentinel services to the cluster.

At the base of Redis replication (excludi ng the high availability features provided as an additional layer by Redis Cluster or Redis Sentinel), there is a very simple to use and configure leader follower (master-slave) replication: it allows replica Redis instances to be exact copies of master instances.

The client application is communicating with the sentinel service not with the Redis instance directly and this ensures that if our master Redis instance dies, our application will be still functioning properly as our read/write request will be forwarded to the current master Redis instance that is elected from the quorum.

And to check which instance is the current master node we can run these commands: In this article, we learned to set up 3 node Redis cluster, we started by setting up authentication and application, then we set the sentinel services, and at the end, we set up the client applications and test the high availability.

Related Articles