How to enable redis in cluster mode

To configure redis in cluster mode we need to run some ruby script. So we
first need to download and install ruby.

Download Ruby from http://rubyinstaller.org/downloads/

Now that ruby is installed we can run the script to enable cluster mode.
This script is present inside ruby-script folder of your redis
installation.Name of the script is redis-trib.rb.

Execute the Ruby script redis-trib.rb located at <REDIS_HOME>\ruby-script

Execute the following command to configure Redis cluster with three master nodes and no slave nodes:

      ruby redis-trib.rb create <machine-ip>:<port> <machine-ip>:<port> <machine-ip>:<port>

Execute the following command to configure Redis cluster with three master nodes and three slave nodes:

      ruby redis-trib.rb create –replicas 1 <machine-ip>:<port> <machine-ip>:<port> <machine-ip>:<port>  

      <machine-ip>:<port> <machine-ip>:<port> <machine-ip>:<port>

It is followed by 6 ip addresses. 1st will b master, 2nd will b slave to 1st, 3rd will be master
and 4th will be slave to 4th and 5th will also be master with 6th node being
slave to 5th node.

Uday Ogra

Connect with me at http://facebook.com/tendulkarogra and lets have some healthy discussion :)

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *