Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

问个问题,连接层如何负载均衡? #8

Open
pigLoveRabbit520 opened this issue Jul 8, 2020 · 2 comments
Open

问个问题,连接层如何负载均衡? #8

pigLoveRabbit520 opened this issue Jul 8, 2020 · 2 comments

Comments

@pigLoveRabbit520
Copy link

comet(用户连接层)可以有多个节点,用户连服务器是一个域名对应一个ip,如何让用户能够随机连到不同的节点呢?

@LonelySally
Copy link

这个就单纯的负载均衡问题.部署多个节点之后向负载管理中心注册部署信息.用户需要ws连接时向负载管理中心索取ws链接地址与auth信息.前端拿着信息直接ws连接即可.负载均衡算法目前最通用的方法hash一致.假设ws服务器2台分别是192.168.0.3,192.168.0.4,负载管理中心为192.168.0.2.流程: .3 .4服务启动向.2注册部署信息.用户A发起ws连接需求,.2对用户A做hash一致,取到了ws链接192.168.0.3,auth信息为xxx.前端发起ws链接并发送auth信息xxx即可完成.

@pigLoveRabbit520
Copy link
Author

@XWR940711 谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants