[2019-03-05T04:17:38,592][WARN ][o.e.d.h.HttpInfo ] [es-node-01] [http.publish_host] was printed as [ip:port] instead of [hostname/ip:port]. This format is deprecated and will change to [hostname/ip:port] in a future version. Use -Des.http.cname_in_publish_address=true to enforce non-deprecated formatting.
I'm not sure exactly what this means or how to resolve it. Any help would be appreciate it!
Many client libraries supporting "sniffing" where they connect to one node in the cluster and then use the _nodes API to determine the base URLs for the other nodes.
In older versions of Elasticsearch (5.0 to 6.5) that "publish_address" would always be an IP address, and not a CNAME (DNS/hostname).
In future versions of Elasticsearch (7.0 and later) that "publish_address" will include both the CNAME and the IP in the format: hostname/ip:port
For 6.6 and later 6.x releases, this is a configurable behaviour. By default it will behave like 6.5, but you can turn on the 7.0 style behaviour.
The warning you are getting is telling you that you are using the old behaviour, but this is going to change in a future release of Elasticsearch.
If you pass -Des.http.cname_in_publish_address=true when you start Elasticsearch (It's a Java system property, not a setting in the yml file), then you will get the new behaviour and this warning will go away.
@TimV Thanks for the thorough explanation. Indeed, I sat the setting via the ES_JAVA_OPTS environment variable and that seemed to silence the warning log:
It's really confusing getting this error message when you only have a hostname that's not a CNAME and see it complaining about a CNAME.
[2019-04-01T22:42:01,820][WARN ][o.e.d.h.HttpInfo ] [YhxttGD] [http.publish_host] was printed as [ip:port] instead of [hostname/ip:port]. This format is deprecated and will change to [hostname/ip:port] in a future version. Use -Des.http.cname_in_publish_address=true to enforce non-deprecated formatting.
It isn't asking you to fix something.
It is warning you that your cluster is behaving in a particular way, and that if/when you upgrade to 7.0 it will behave in a different way.
This is about your cluster sending a response, and the format of that response is going to change in 7.0; It has nothing to do with the way you are configuring your hostnames or publish addresses, it's only about how ES formats them in particular REST responses.
You don't have to do anything, but if you have a client that relies on the current behaviour, then it will break when you upgrade to 7.0.
The ES server cannot tell whether you have such a client we don't know how those responses are being consumed, so the only option is to issue that warning on all clusters.
If you want to silence the warning, you can do so by making the change now (on 6.7) to format responses with the new (7.0) style of address. You do this by setting the es.http.cname_in_publish_address system problems as described above:
Yes, because it you set your network.publish_host to an IP address, then we will only ever publish an IP address in the REST responses.
If you set network.publish_host to named address (hostname/CNAME etc) then we have 2 things that we can publish, the name and the IP. In 6.6, when we publish the node's HTTP address we just publish the IP. In 7.0 we will publish both.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.