As a production-level clustering solution for an enterprise Redis cluster has a mature set of tools for performing management functions related to running cluster of Redis nodes. Redis cluster supports the following functions primarily through an included Ruby script, redis-trib.rb
utility:
Resharding and failover
Moving or creating new allocations of hash slots in the cluster
Handling error conditions such as master failing
Adding or replacing master or slave nodes in the cluster
Upgrading a master or slave instance
To test these various functions in Redis cluster, we will return to the area code example introduced earlier in the chapter and migrate our list-based solution to use Redis cluster instead of our custom client code. Building from the official Redis cluster tutorial example at http://redis.io/topics/cluster-tutorial
, we will run the simplest recommended three master with three slave Redis cluster. The create-cluster
utility bundled with Redis is the easiest method...