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

gatewaywork集群下有多台gateway服务器,客户端(PC、APP)应该连接哪一个gateway? #56

Closed
keehao opened this issue Dec 28, 2018 · 1 comment

Comments

@keehao
Copy link

keehao commented Dec 28, 2018

gatewaywork集群下有多台gateway服务器,客户端(PC、APP)应该连接哪一个gateway?
比如:
1,192.168.1.1机器的start_gateway.php配置$gateway = new Gateway("Websocket://192.168.1.1:7272");
2,192.168.1.2机器的start_gateway.php配置$gateway = new Gateway("Websocket://192.168.1.2:7272");
这时候客户端应该如何做,还是随机的连接这两个gateway任意一个?

@walkor
Copy link
Owner

walkor commented Dec 29, 2018

客户端随意连一个即可。
可以在客户端前加一个负载均衡,例如
1、可以用域名添加2个A记录,dns会自动选择一个ip供客户端连
2、可以加一个lvs(类似阿里云的slb),lvs会自动转发消息给后端一个ip
3、可以加一个haproxy/nginx类似的代理,代理会自动转发消息给后端一个ip

@walkor walkor closed this as completed Mar 12, 2019
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