Nodes discovered by sniffer are not correct when publish_address is hostname/ip:port

Hi,

ES version: 7.0.0 (also had issues with 6.6.2)

I'm using a hostname as the publish_host on my server nodes:

network.publish_host: es-node-1

And use a REST high level client with a sniffer, and end up with connection refused errors. If I disable the sniffer and only use the seed hosts, everything works fine.

The nodes discovered by the sniffer are using the "publish_address" exposed by /_nodes/http, which is now using the hostname/ip:port notation, I guess since https://github.com/elastic/elasticsearch/commit/94cdf0cebacde4188e6ca5f84843d732aae8cf7c#diff-7da1adce73ed1e7e6629fd8d0c0e708b

But the sniffer parses the publish_address using a URI in ElasticsearchNodesSniffer, so the ip:port part ends up being part of the URI's path and the port number is ignored, so the client tries to connect on port 80, which isn't listening.

If I change the publish_host on the server to be the IP, then the discovered host are correct.

Looking at the tests for ElasticsearchNodesSniffer, all the _nodes_http.json have a publish address with the IP only.

Is the network.publish_host always supposed to be an IP rather than a hostname or should the node sniffer handle publish addresses with hostname/ip:port?
Or am I missing additional configuration to make this work?

Thanks

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.