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

etcd服务器集群,集群重启后,无法重连 #790

Closed
whitekeyboard opened this issue Oct 15, 2020 · 5 comments
Closed

etcd服务器集群,集群重启后,无法重连 #790

whitekeyboard opened this issue Oct 15, 2020 · 5 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@whitekeyboard
Copy link

etcd服务器集群时,如果集群重启后,dubbo-go服务无法连接etcd服务,初步定为为etcd的客户端的BUG,建议修改如下:
https://github.com/apache/dubbo-go/blob/master/remoting/etcdv3/facade.go line 66, line 80如下:

endpoint := r.GetUrl().Location
...
err = ValidateClient(
				r,
				WithName(clientName),
				WithEndpoints(endpoint),
				WithTimeout(timeout),
			)

建议修改为:

endpoint := strings.Split(r.GetUrl().Location, ",")
...
err = ValidateClient(
				r,
				WithName(clientName),
				WithEndpoints(endpoint...),
				WithTimeout(timeout),
			)

@zouyx
Copy link
Member

zouyx commented Oct 15, 2020

etcd服务器集群时,如果集群重启后,dubbo-go服务无法连接etcd服务,初步定为为etcd的客户端的BUG,建议修改如下:
https://github.com/apache/dubbo-go/blob/master/remoting/etcdv3/facade.go line 66, line 80如下:

endpoint := r.GetUrl().Location
...
err = ValidateClient(
				r,
				WithName(clientName),
				WithEndpoints(endpoint),
				WithTimeout(timeout),
			)

建议修改为:

endpoint := strings.Split(r.GetUrl().Location, ",")
...
err = ValidateClient(
				r,
				WithName(clientName),
				WithEndpoints(endpoint...),
				WithTimeout(timeout),
			)

十分感谢,如果有可能,可以提交 PR

@zouyx zouyx added this to the v1.5.3 milestone Oct 16, 2020
@AlexStocks
Copy link
Contributor

cc @hequn

@watermelo watermelo self-assigned this Oct 25, 2020
@watermelo
Copy link
Member

watermelo commented Oct 25, 2020

etcd服务器集群时,如果集群重启后,dubbo-go服务无法连接etcd服务,初步定为为etcd的客户端的BUG,建议修改如下:
https://github.com/apache/dubbo-go/blob/master/remoting/etcdv3/facade.go line 66, line 80如下:

endpoint := r.GetUrl().Location
...
err = ValidateClient(
				r,
				WithName(clientName),
				WithEndpoints(endpoint),
				WithTimeout(timeout),
			)

建议修改为:

endpoint := strings.Split(r.GetUrl().Location, ",")
...
err = ValidateClient(
				r,
				WithName(clientName),
				WithEndpoints(endpoint...),
				WithTimeout(timeout),
			)

你好,我这边使用的是 dubbogo 1.5.3 版本,3 台 etcd 的集群,当我重启集群后 dubbogo 可以恢复重连。可以提供版本,报错截图,或者更多的信息么?@whitekeyboards

@watermelo watermelo added the question Further information is requested label Oct 25, 2020
@whitekeyboard
Copy link
Author

whitekeyboard commented Oct 28, 2020

@watermelo 我找不到之前的例子了,我又重新使用dubbo-sample的范例,修改了一下,可以实现重连。
但是这里有个疑问:
对比https://github.com/apache/dubbo-go/blob/master/remoting/zookeeper/client.go 的Line137,138,zookeeper此处的实现,会使用逗号分隔,是否使用此更加合理一些。使用逗号分隔的场景,etcd是否会用到?zookeeper既然有此场景,etcd是否也需要支持一下?
请帮忙解答一下,谢谢!

@watermelo
Copy link
Member

watermelo commented Oct 31, 2020

@whitekeyboard 已修复 #828

@watermelo watermelo added bug Something isn't working and removed question Further information is requested labels Oct 31, 2020
@watermelo watermelo modified the milestones: v1.5.5, v1.5.4 Oct 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants