Elasticsearch http.host default value

In the elasticsearch version 8.12 docs says "network.host default value is localhost and http.host value defaults is address given by network.host". But for default in fresh new elasticsearch http.host is equal 0.0.0.0 without comment. Is it mistake in docs or in the default config?

Ok this is kind of confusing indeed.

If http.host is not set in elasticsearch.yml then it does indeed fall back to network.host; if network.host is also not set in elasticsearch.yml then the default behaviour is indeed to bind only to localhost.

However, if you start up a node for the first time with a completely unchanged elasticsearch.yml then security auto-configuration will add various options to your elasticsearch.yml, including http.host: 0.0.0.0, so that you can later enroll other nodes in this cluster. If you remove the http.host: 0.0.0.0 line from the file then it will go back to just using localhost.

2 Likes

Yeah, if I remove http.host from the config, then in the
_cluster/settings?include_defaults http.host will indeed inherit the value of network.host. Would it be a best practice to just remove http.host or change it to _local_, if I am planning a single-node configuration?

Technically the docs here recommend just to set network.host: 127.0.0.1 and no other network settings, but I'm not sure it makes any difference in practice in almost all cases.

1 Like

I opened Security auto-config overrides default `http.host` by DaveCTurner · Pull Request #105377 · elastic/elasticsearch · GitHub to improve the docs in this area.

1 Like

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