作者:何丽-Hely | 来源:互联网 | 2023-10-12 19:31
集群原来是CRC校验和,和16384的取模。

如何取代呢?


集群就是解决两个问题:
1.hash拆分
2.故障转移
----------------------------------------------------------------------7-1-------------------------------------------------------------------------------------
一致hash算法:
分片的原则:key尽量的散列在集群的所有节点。

----------------------------------------------------------------------7-2-------------------------------------------------------------------------------------
虚拟节点:

----------------------------------------------------------------------7-3-------------------------------------------------------------------------------------

没办法做到完全的平均分布的。
放在分布式的rpa框架里面。
----------------------------------------------------------------------7-4-------------------------------------------------------------------------------------
客户端分片:一致性hash。
服务器分片:还有codis。


一致性hash算法:
https://blog.csdn.net/qq_34672033/article/details/88916789
https://blog.csdn.net/cb_lcl/article/details/81448570
----------------------------------------------------------------------7-5-------------------------------------------------------------------------------------