Consul status shows service trying to use wrong address for proxy
search cancel

Consul status shows service trying to use wrong address for proxy

book

Article ID: 277668

calendar_today

Updated On:

Products

DX NetOps CA Performance Management - Usage and Administration

Issue/Introduction

When checking the status of the consul service:

systemctl status consul

on the DA’s we see this error:

2024-01-04T05:40:33.617-0500 [INFO]  agent: Joining cluster...: cluster=LAN

2024-01-04T05:40:33.617-0500 [INFO]  agent: (LAN) joining: lan_addresses=["PROXY-HOSTNAME"]

2024-01-04T05:40:33.618-0500 [WARN]  agent: (LAN) couldn't join: number_of_nodes=0

  error=

  | 1 error occurred:

  |        * Failed to join 10.x.x.x:8301: dial tcp 10.x.x.x:8301: connect: connection refused

Environment

DX NetOps: All Supported Versions

Cause

The proxy is binding to a 172.x.x.x address.

But the "retry_join" value in the

/opt/IMDataAggregator/consul/conf/config.json

was using the proxy hostname, and the DA was resolving that hostname to the wrong IP address due to local hosts files.

Resolution

Replace the proxy hostname

"retry_join" : ["PROXY-HOSTNAME"],

Value with the actual IP address of the proxy to bypass the name resolution problems.

Additional Information

config.json

{
    "datacenter": "capm",
    "data_dir": "/opt/IMDataAggregator/consul/data",
    "server" : true,
    "ui_config" : {
        "enabled": true
    },
    "bootstrap_expect" : 3,
    "acl": {
      "enabled": true,
      "default_policy": "allow",
      "enable_token_persistence": true
    },
    "client_addr": "0.0.0.0",
    "advertise_addr": "172.x.x.x",
    "retry_join" : ["PROXY-HOSTNAME"],
    "ports": { "http": 8500 }
}