I'm trying to set up unicast discovery. I want to pass in the hosts via
environment variable and am relying on elasticsearch.yml support of
environment variable interpolation.
Tried two formats without any luck:
First approach (pass in contents of array):
export ES_HOSTS='"one", "two"'
discovery.zen.ping.unicast.hosts: [${ES_HOSTS}]
org.elasticsearch.common.settings.SettingsException: Failed to load
settings from [file:/etc/elasticsearch/elasticsearch.yml]
at
org.elasticsearch.common.settings.ImmutableSettings$Builder.loadFromStream(ImmutableSettings.java:920)
at
org.elasticsearch.common.settings.ImmutableSettings$Builder.loadFromUrl(ImmutableSettings.java:904)
at
org.elasticsearch.node.internal.InternalSettingsPreparer.prepareSettings(InternalSettingsPreparer.java:77)
at
org.elasticsearch.bootstrap.Bootstrap.initialSettings(Bootstrap.java:106)
at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:177)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32)
Caused by: while parsing a flow sequence
in 'reader', line 326, column 35:
discovery.zen.ping.unicast.hosts: [${ES_HOSTS}]
^
expected ',' or ']', but got FlowMappingStart
in 'reader', line 326, column 37:
discovery.zen.ping.unicast.hosts: [${ES_HOSTS}]
Second Approach (pass in full quoted array):
export ES_HOSTS='["one", "two"]'
discovery.zen.ping.unicast.hosts: ${ES_HOSTS}
- ElasticsearchIllegalArgumentException[Failed to resolve address for
[["es1"]]]
NumberFormatException[For input string: ""es1""]2)
IllegalStateException[This is a proxy used to support circular references
involving constructors. The object we're proxying is not constructed yet.
Please wait until after injection has completed to use this object.]
Any ideas? Is there a doc somewhere that describes how the interpolation
occurs? The first error scares me a bit as it seems interpolation happens
after some other parsing.
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/701b9022-b4e5-4422-b376-ab01fba3c233%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.