问题:打包成docker的服务,启动时etcd写入问题 背景
1. etcd启动在宿主机的0.0.0.0:2379 2. docker启动的时候,连接报错 2.1 指定etcd的ip为docker0时, 报{"level":"warn","ts":"2021-09-25T10:19:56.878Z","logger":"etcd-client","caller":"v3@v3.5.0/retry_interceptor.go:62","msg":"retrying of unary invoker failed","target":"etcd-endpoints://0xc0005328c0/#initially=[172.17.0.1:2379]","attempt":0,"error":"rpc error: code = DeadlineExceeded desc = latest balancer error: last connection error: connection error: desc = \"transport: Error while dialing dial tcp 172.17.0.1:2379: connect: no route to host\""}
2.2 指定etcd的ip为0.0.0.0,报{"level":"warn","ts":"2021-09-25T10:21:30.406Z","logger":"etcd-client","caller":"v3@v3.5.0/retry_interceptor.go:62","msg":"retrying of unary invoker failed","target":"etcd-endpoints://0xc000594540/#initially=[0.0.0.0:2379]","attempt":0,"error":"rpc error: code = DeadlineExceeded desc = latest balancer error: last connection error: connection error: desc = \"transport: Error while dialing dial tcp 0.0.0.0:2379: connect: connection refused\""}