Cluster Mode

A single Dragonfly instance can achieve the same capacity as a multi node Redis Cluster. In order to help with migrating an application from a Redis Cluster to Dragonfly, Dragonfly can emulate a Redis Cluster.

  1. # Running Dragonfly instance in cluster mode
  2. $ dragonfly --cluster_mode=emulated
  3. $ redis-cli
  4. # See which cluster commands are supported
  5. 127.0.0.1:6379> cluster help

Now you can connect to your Dragonfly instance with a Redis Cluster client, here’s a python example:

  1. >>> import redis
  2. >>> r = redis.RedisCluster(host='localhost', port=6379)
  3. >>> r.set('foo', 'bar')
  4. True
  5. >>> r.get('foo')
  6. b'bar'

Note that your application code may be using a redis client that does not require cluster commands, in this case you don’t need to specify the --cluster_mode flag.

In case you need to migrate data from Redis Cluster to Dragonfly you may find Redis Riot helpful.