openimsdk / open-im-server

IM Chat
https://openim.io
Apache License 2.0
13.39k stars 2.36k forks source link

[Other]: How is consistent hashing implemented for sharding WebSocket connections in openim k8s? #2298

Open hezhenke opened 1 month ago

hezhenke commented 1 month ago

What would you like to share?

看代码没有看懂,目前有k8s和zookeeper两种分片逻辑,k8s通过用户id哈希一致性,选定长链接节点。

我的问题是用户建立连接的时候,是在哪里让客户端根据用户ID哈希和对应的websocket服务器节点建立长链接的。

Additional information

No response

kubbot commented 1 month ago

Hello! Thank you for filing an issue.

If this is a bug report, please include relevant logs to help us debug the problem.

Join slack 🤖 to connect and communicate with our developers.