当我在领事服务器和客户端上运行任何"consul members"
时,我都会得到这个错误。端口处于监听状态,我确保没有防火墙阻塞。在领事客户端运行相同的错误时,我会得到以下错误:
检索成员时出错:获取http://127.0.0.1:8500/v1/agent/members: 拨号tcp 127.0.0.1:8500: connectex:由于目标计算机主动拒绝连接,因此无法建立连接。
当我使用私有IP发出上述请求时,我将得到所需的输出。我可以在任何地方更改配置,以便它侦听私有IP上的请求吗?
发布于 2017-05-12 00:23:20
您的consul members
似乎缺少-http-addr=...
选项。
示例
consul members -http-addr=10.10.10.10:8500
假设您使用领事代理的标准端口8500
并通过以下方式启动领事:
consul agent -client=10.10.10.10 #...
在哪里可以找到文档?
consul members -helphttp-addr=<address> The
addressand port of the Consul HTTP agent. The value can be an IP address or DNS address, but it must also include the port. This can also be specified via the CONSUL_HTTP_ADDR environment variable. The default value is http://127.0.0.1:8500. The scheme can also be set to HTTPS by setting the environment variable CONSUL_HTTP_SSL=true.
脱机https://stackoverflow.com/questions/43730582
复制相似问题