go-zero
go-zero copied to clipboard
etcd error:retrying of unary invoker failed
配置etcd后,启动后一段时间开始不断报错,内容如下:
{"level":"warn","ts":"2023-03-22T12:42:04.341+0800","logger":"etcd-client","caller":"[email protected]/retry_interceptor.go:62","msg":"retrying of unary invoker failed","target
":"etcd-endpoints://0xc0000f9500/10.0.xxx.xx:2379","attempt":0,"error":"rpc error: code = DeadlineExceeded desc = latest balancer error: last connection error: connecti
on error: desc = "transport: Error while dialing: dial tcp 127.0.0.1:2379: connectex: No connection could be made because the target machine actively refused it.""}
{"level":"info","ts":"2023-03-22T12:42:04.342+0800","logger":"etcd-client","caller":"[email protected]/client.go:210","msg":"Auto sync endpoints failed.","error":"context deadl
ine exceeded"}
yaml:
Name: base-rpc
ListenOn: 0.0.0.0:2004
Mode: dev
Etcd:
Hosts:
- 10.0.xxx.xx:2379
Key: base123.rpc
ETCD里可以看到注册key:
启动服务会有几率(几率还比较高,偶尔会不出现这样的警告信息)出现1条或2条这样的警告信息,我也碰到这个问题了,只是有这样的警告信息,但是对服务之间的调用没有影响

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
There will be a chance of starting the service (the probability is relatively high, and occasionally such a warning message will not appear). One or two such warning messages will appear. I have also encountered this problem, but there is such a warning message, but for the service Calls between

Please make sure you can access etcd server out of the docker container.
我也遇到了这个问题,并且出现后rpc服务就不可用了. 首先确认你是不是再docker上部署的etcd,我改换为本地部署的etcd后就不存在该问题了(应该是某些配置文件设置问题)
I also encountered this problem and the rpc service became unavailable afterwards. First, confirm if you are deploying etcd on Docker. After changing to locally deployed etcd, the problem no longer exists (it should be a configuration file setting issue).
I have also encountered it. Have you found a solution yet.
I have also encountered it. Have you found a solution yet.
经过实验,当etcd服务监听内网IP并且使用内网IP连接,这个错误可以避免。
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
Is there a solution? I also encountered.
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
Is there a solution? I also encountered that the etcd cluster starts normally and is available.
有解决方案吗?我也遇到了,etcd集群正常启动可用。
go-zero启动一段时间后一直报这个警告,但是不影响使用,可以正常访问。
I'm facing the same issue and my rpc become unavailable.
- The etcd is dockernized
- My microservices are running as standalone ( undockernized )
- Each time I've to restart my microservices
Any fix please ?
I'm facing the same issue and my rpc become unavailable.
- The etcd is dockernized
- My microservices are running as standalone ( undockernized )
- Each time I've to restart my microservices
Any fix please ?
II suggest you run both your etcd and microservices in either a containerized (dockernized) or non-containerized (undockernized) manner. Based on my experience in production environments, both approaches are feasible.
Same error encountered when deploying standalone on WSL2 using docker-compose. It works on windows though.