Lets say you are trying to configure 3 masters, after your three masters are up in cluster mode(individually), then you should execute the following on command line.
The above will allow the three nodes to meet. Then the below
for slot in {0..5461}; do redis-cli -h 127.0.0.1 -p 7000 CLUSTER ADDSLOTS $slot; done;
for slot in {5462..10923}; do redis-cli -h 127.0.0.1 -p 7001 CLUSTER ADDSLOTS $slot; done;
for slot in {10924..16383}; do redis-cli -h 127.0.0.1 -p 7002 CLUSTER ADDSLOTS $slot; done;
this will assign them the slots.
That is it. You should see the cluster info command to check that everything is fine.
If there are different no of nodes, your calculation will be a bit diff(like for 2 nodes, it will be 0..8191, 8192..16383), but the procedure will be the same
Also, the above is for masters only,
If you want to further add slaves(lets say 7003 as slave of 7000, 7004 as slave of 7001, 7005 as slave of 7002), then do the following after starting 7003,7004,7005 individually.
redis-cli -c -h 127.0.0.1 -p 7000 cluster meet 127.0.0.1 7003
redis-cli -c -h 127.0.0.1 -p 7000 cluster meet 127.0.0.1 7004
redis-cli -c -h 127.0.0.1 -p 7000 cluster meet 127.0.0.1 7005
redis-cli -c -h 127.0.0.1 -p 7003 cluster replicate <node_id_of_7000>
redis-cli -c -h 127.0.0.1 -p 7004 cluster replicate <node_id_of_7001>
redis-cli -c -h 127.0.0.1 -p 7005 cluster replicate <node_id_of_7002>
You can find the <node_id_of_7000> etc from cluster nodes command by doing redis-cli -c -h 127.0.0.1 -p 7000 cluster nodes