As we known, redis cluster have 16384 hash slots.when redis client connect to redis cluster, how redis client to connect real save data redis node?
Asked
Active
Viewed 62 times
1 Answers
0
The rule is quite simple, redis use CRC16(key) % 16384
to determine which slot will a key go in. If you want to do everything by yourself, you just need to calculate every key's crc16.
But generally, you don't need to do these by yourself. At the moment, almost every well-known client, like jedis, predis,StackExchange.Redis , supports the cluster mode.

Mobility
- 3,117
- 18
- 31