I have two consul servers running in a cluster. When I run $ consul members command on one, it works fine, but on the other it gives the error:
Error connecting to Consul agent: dial tcp 127.0.0.1:8400: getsockopt: connection refused
On the second server I have to use the option --rpc-addr to get the results. Why this discrepancy? Any comments?
Host1:
Launch command:
$ consul agent -server -data-dir /var/consul -node=Host1 -bind=10.244.44.1 -config-dir=/etc consul.d
Members command:
[root@Host1 server]# consul members
Node Address Status Type Build Protocol DC
Host2:
Launch command:
$ consul agent -server -data-dir /tmp/consul -node=Host2 -bind=10.244.44.2 -config-dir /etc consul.d -client=10.244.44.2
Members command:
[root@Host2 ssl]# consul members -detailed
Error connecting to Consul agent: dial tcp 127.0.0.1:8400: getsockopt: connection refused
[root@Host2 ssl]# consul members --rpc-addr=10.244.44.2:8400
Node Address Status Type Build Protocol DC