我正在尝试运行领事连接代理,但它显示意外错误
这是我的配置
{
"service": {
"name": "api",
"check": {
"name": "HTTP 80",
"http": "http://localhost:80",
"interval": "10s",
"timeout": "10s"
},
"connect": {
"sidecar_service": {
"proxy":{
"upstreams":[{
"destination_name": "elasticsearch",
"local_bind_port": 9200
}]
}
}
}
}
}以下命令使用日志记录$ consul connect proxy -sidecar-for elasticsearch ==> Consul Connect proxy starting...配置方式:ID为: elasticsearch的代理API Sidecar代理ID: elasticsearch-sidecar-proxy
==> Log data will now stream in as it occurs:
2019/06/03 08:00:54 [INFO] Proxy loaded config and ready to serve
2019/06/03 08:00:54 [INFO] TLS Identity: spiffe://fadce594-37c1-8586-1b57-c6245436684c.consul/ns/default/dc/dc1/svc/elasticsearch
2019/06/03 08:00:54 [INFO] TLS Roots : [Consul CA 8]
2019/06/03 08:00:54 [INFO] public listener starting on 0.0.0.0:21000
2019/06/03 08:01:02 [ERR] failed to dial: dial tcp 127.0.0.1:0: connect: connection refused
^C==> Consul Connect proxy shutdown有什么建议吗?
发布于 2019-06-03 18:51:58
这个问题是因为服务没有端口,所以它尝试连接到proxy.local_service_port - Defaults to the parent service port.
为父服务指定端口可解决此问题
https://stackoverflow.com/questions/56425051
复制相似问题