Cant use environment variables in elasticsearch.yml


(red der) #1

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


(Jared Carey) #2

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


(Bernt Rostad) #3

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.


(system) #4

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