Cant use environment variables in elasticsearch.yml

My variable is set
# echo $ESCLUSTER
es-datanode-01,es-datanode-02

In ES config I have:
discovery.zen.ping.unicast.hosts: "${ESCLUSTER}"

The service won't start.

If I add the string explicitly it does start:
discovery.zen.ping.unicast.hosts: "es-datanode-01,es-datanode-02"

I can't use environemtns vars in my config

Are you running / initializing elasticsearch with the same user that you have the environment variable set in?

Skip the quotation marks and it should work:

discovery.zen.ping.unicast.hosts: ${ESCLUSTER}

We do that and it works equally well if ESCLUSTER is just one server or a list of servers.

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