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

生产环境中的上线切流量问题 #78

Closed
jimmy-kuo opened this issue Mar 17, 2016 · 2 comments
Closed

生产环境中的上线切流量问题 #78

jimmy-kuo opened this issue Mar 17, 2016 · 2 comments

Comments

@jimmy-kuo
Copy link

Hi:
一直有个问题想咨询下您,我看到wiki上有描述了client是支持链接探活的(针对server端服务不可用的情况)。但是,如果用于生产环境,那么肯定存在一个上线时切流的问题,所以想问下,有没有类似于zookeeper的机制,能够保障主动切流量且不影响线上服务的feature。
谢谢

@qinzuoyan
Copy link
Collaborator

这个问题是有考虑的。其实在公司内部的sofa-pbrpc已经支持了这个功能,就是使用zookeeper来动态获取server地址,只是在开源的时候没有放进来。
实现起来也很简单,具体做法就是:实现AddressProvider接口,该实现负责监听zookeeper节点的变动,当节点数据发生变动的时候(server增删),就调用EventHandler通知client。
你可以参考sample/multi_server_sample下的样例代码。wiki参见:高级使用中的“多Server负载均衡与容错”这一节。

@jimmy-kuo
Copy link
Author

ok,回头我再自己研究下实现方案,感谢回答

@cyshi cyshi closed this as completed Sep 2, 2016
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

3 participants