why Adding replica 192.168.80.128:6680 to 192.168.80.128:6679 but print this message below M: 10194f737f6d4b4d35066c7d884c840a35b00d90 192.168.80.128:6679 slots:[0-4095] (4096 slots) master S: b630a98ad03fb5d734458b16db064959fdad5319 192.168.80.128:6680 replicates b2bb8125035702b6725460f7d33da4696fc9ae4a
the instanceId add to port 6681
How can i create masters and slaves in a fixed order.
Performing hash slots allocation on 8 nodes... Master[0] -> Slots 0 - 4095 Master[1] -> Slots 4096 - 8191 Master[2] -> Slots 8192 - 12287 Master[3] -> Slots 12288 - 16383 Adding replica 192.168.80.128:6680 to 192.168.80.128:6679 Adding replica 192.168.80.128:6682 to 192.168.80.128:6681 Adding replica 192.168.80.128:6684 to 192.168.80.128:6683 Adding replica 192.168.80.128:6686 to 192.168.80.128:6685 Trying to optimize slaves allocation for anti-affinity [WARNING] Some slaves are in the same host as their master M: 10194f737f6d4b4d35066c7d884c840a35b00d90 192.168.80.128:6679 slots:[0-4095] (4096 slots) master M: b2bb8125035702b6725460f7d33da4696fc9ae4a 192.168.80.128:6681 slots:[4096-8191] (4096 slots) master M: 8d9047fdbd73817921d6c82e9aa11f3363032b16 192.168.80.128:6683 slots:[8192-12287] (4096 slots) master M: 27a53581e5bca16af67b875663a7fbb8306f7ee8 192.168.80.128:6685 slots:[12288-16383] (4096 slots) master S: b630a98ad03fb5d734458b16db064959fdad5319 192.168.80.128:6680 replicates b2bb8125035702b6725460f7d33da4696fc9ae4a S: 499f7355d12fced3a720f4a5a451d0f1344ab458 192.168.80.128:6682 replicates 8d9047fdbd73817921d6c82e9aa11f3363032b16 S: ca4192b923a24677cf03d8c361fde8610bc10e72 192.168.80.128:6684 replicates 10194f737f6d4b4d35066c7d884c840a35b00d90 S: 0ea4bf24f6c3bfb3c3a501c44003a7ec9bf456f0 192.168.80.128:6686 replicates 27a53581e5bca16af67b875663a7fbb8306f7ee8
Comment From: artix75
@canthny Because after the initial assignment, the anti-affinity optimization can re-assign replicas in order to optimize the cluster's configuration by trying to avoid that replicas stay in the same host of their masters (since if the host should go down, both master and replicas would be down). You can see that this is happening by checking those messages:
Trying to optimize slaves allocation for anti-affinity
[WARNING] Some slaves are in the same host as their master
The second message means that, despite the efforts of the anti-affinity optimization algorithm, some replicas are still in the same host as their masters.