- You are supposed to assign the roles one by one; or write a script by yourself, to properly send
cluster addslots
, cluster meet
and cluster replicate
commands to the right Redis
- Not suggested to do so in the cluster environment, and here are some words from antirez himself
- It affects only the one you send
config set maxmemory
to. It's possible that different nodes in a cluster have different maxmemory, and serve different numbers of slots
===
More details about #1:
First choose your master instances, use redis-trib.rb create
without --replicas
. Now you have a cluster that contains only masters.
Connect to each of your desired slaves with redis-cli
, and send these commands
> cluster meet MASTER_IP MASTER_PORT
# wait several seconds, and use cluster nodes to ensure that it has joined the cluster
> cluster replicate MASTER_NODE_ID
# wait, and use cluster nodes to ensure it has become a slave