Help me set elasticsearch.yml variable

This is the contents of my elasticsearch.yml file. test-cluster test-m
node.master: true false

cluster.initial_master_nodes: ["${ES_MASTER_NODES}"]
discovery.seed_hosts: ["${ES_SEED_HOSTS}"]
network.publish_host: ${ES_PUBLISH_HOST}

'discovery.seed_hosts' don't recognize it properly

'discovery.seed_hosts : [' ',' ',' ']
Works fine.
However, I want to create a variable called '$ {ES_SEED_HOSTS}' and use it to run it.

${ES_SEED_HOSTS} = "'','',''"

[2020-03-19T08:04:10,831][WARN ][o.e.d.SeedHostsResolver ] [test-m] failed to resolve host ['']Preformatted text ''
[2020-03-19T08:04:10,831][WARN ][o.e.d.SeedHostsResolver ] [test-m] failed to resolve host [''] ''
[2020-03-19T08:04:10,831][WARN ][o.e.d.SeedHostsResolver ] [test-m] failed to resolve host [''] ''

How should we put the value of the variable?
{ES_SEED_HOSTS} / ~ export ES_SEED_HOSTS=" ?? "

I'm using an older (6.8) version of Elasticsearch so I call my environment variable ES_DISOVERY_HOSTS which I export with a setting like this:

export ES_DISCOVERY_HOSTS="master1:9260","master2:9260","master3:9260"

where I include the port numbers because I run several master eligible instances on the same physical servers (listening to different ports for different clusters).

Then all I need to do in elasticsearch.yml on each data node is add ${ES_DISCOVERY_HOSTS}

In your case this would be discovery.seed_hosts.

Good luck!

The version I installed is 7.4.2
If you enter it directly without using an environment variable, the execution will work fine.
What I want is to put an environment variable in discovery.seed_hosts but is that impossible?

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