# Syntax to specify multiple hosts using ELASTICSEARCH\_HOSTS env?

**URL:** <https://discuss.elastic.co/t/syntax-to-specify-multiple-hosts-using-elasticsearch-hosts-env/221306>\
**Category:** Kibana\
**Created:** [February 27, 2020, 6:29pm UTC](https://discuss.elastic.co/t/syntax-to-specify-multiple-hosts-using-elasticsearch-hosts-env/221306 "2020-02-27T18:29:57Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![tiagocosta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tiagocosta/32/40045_2.png) [@tiagocosta](https://discuss.elastic.co/u/tiagocosta)\
**Post date:** [March 20, 2020, 2:25am UTC](https://discuss.elastic.co/t/syntax-to-specify-multiple-hosts-using-elasticsearch-hosts-env/221306/5 "2020-03-20T02:25:47Z")

</div>

@Supermathie can you please be sure that you are not mistype any part of it?  
I was able to find two different places where people states that it worked as expected.

> <https://github.com/elastic/kibana/issues/42024>
>
> \*\*Kibana version:\*\* 7.2.0
> 
> \*\*Elasticsearch version:\*\* 7.2.0
> 
> \*\*Server OS ver…sion:\*\* MacOS
> 
> \*\*Browser version:\*\* N/A
> 
> \*\*Browser OS version:\*\* N/A
> 
> \*\*Original install method (e.g. download page, yum, from source, etc.):\*\* Docker
> 
> \*\*Describe the bug:\*\*
> When trying to pass an array in the \`ELASTICSEARCH\_HOSTS\` env variable I'm getting a validation error.
> 
> \*\*Steps to reproduce:\*\*
> I've tried various combinations of quotes, \`\[\` operator, spaces etc. 
> 
> \`docker run --name kibana5 -p 5605:5601 -e ELASTICSEARCH\_HOSTS='\["http://10.45.3.2:9220,http://10.45.3.1:9230"\]' -e "SERVER\_NAME=localhost" docker.elastic.co/kibana/kibana:7.1.1\`
> 
> \*\*Expected behavior:\*\*
> Container starts with an array of ELASTICSEARCH\_HOSTS
> 
> \*\*Actual behavior:\*\*
> Server crashes with log message given below. 
> 
> \*\*Provide logs and/or server output (if relevant):\*\*
> 
> \`\`\`
> ^C{"type":"log","@timestamp":"2019-07-25T20:23:11Z","tags":\["fatal","root"\],"pid":1,"message":"{ ValidationError: child \\"elasticsearch\\" fails because \[child \\"hosts\\" fails because \[\\"hosts\\" at position 0
> fails because \[\\"0\\" must be a valid uri with a scheme matching the http|https pattern\]\]\]\\n at Object.exports.process (/usr/share/kibana/node\_modules/joi/lib/errors.js:196:19)\\n at internals.Object.\_val
> idateWithOptions (/usr/share/kibana/node\_modules/joi/lib/types/any/index.js:675:31)\\n at module.exports.internals.Any.root.validate (/usr/share/kibana/node\_modules/joi/lib/index.js:146:23)\\n at Config.\_
> commit (/usr/share/kibana/src/legacy/server/config/config.js:143:35)\\n at Config.set (/usr/share/kibana/src/legacy/server/config/config.js:111:10)\\n at Config.extendSchema (/usr/share/kibana/src/legacy/
> server/config/config.js:84:10)\\n at extendConfigService (/usr/share/kibana/src/legacy/plugin\_discovery/plugin\_config/extend\_config\_service.js:45:10) name: 'ValidationError' }"}
> 
> FATAL ValidationError: child "elasticsearch" fails because \[child "hosts" fails because \["hosts" at position 0 fails because \["0" must be a valid uri with a scheme matching the http|https pattern\]\]\]
> 
> \`\`\`
> 
> \*\*Any additional context:\*\*

> [@Connecting Kibana to multiple Coordinating Nodes in docker-compose setup](https://discuss.elastic.co/t/connecting-kibana-to-multiple-coordinating-nodes-in-docker-compose-setup/199521):
>
> Hey, I am running an Elasticsearch 7.3.0 cluster via docker-compose with 3 machines that host one MDI and one Coordinating-only node each. On one machine I host Kibana as well. I want Kibana to connect to all three coordinating-nodes due to loadbalancing purposes. Therefore I specify in the environment section of the kibana service the following setting: ELASTICSEARCH\_HOSTS: "https://192.168.2.120:9201,https://192.168.2.121:9201,https://192.168.2.122:9201" However on the startup I get followi…

---

_[View the full topic](https://discuss.elastic.co/t/syntax-to-specify-multiple-hosts-using-elasticsearch-hosts-env/221306)._
