Syntax to specify multiple hosts using ELASTICSEARCH_HOSTS env?

Hi!

i was looking for the same information some weeks ago. Find what works for the docker image of Kibana 6.8.6 OSS (I haven't tried the rest)

Docker compose syntax below:

    kibana:
      image: docker.elastic.co/kibana/kibana-oss:6.8.6
      environment:
        - ELASTICSEARCH_USERNAME=kibanaserver
        - ELASTICSEARCH_PASSWORD=kibanaserver
        - ELASTICSEARCH_HOSTS=["https://elasticsearch1:9200","https://elasticsearch2:9100"]
        - ELASTICSEARCH_SSL_VERIFICATIONMODE=none
      ports:
        - 5602:5601

Pay attention just to the variable ELASTICSEARCH_HOSTS. I pasted all the section to add some context.

The way the env variables are used inside the container is the following:

/usr/share/kibana/bin/../node/bin/node --no-warnings --max-http-header-size=65536 /usr/share/kibana/bin/../src/cli --cpu.cgroup.path.override=/ --cpuacct.cgroup.path.override=/ --elasticsearch.hosts=["https://elasticsearch1:9200","https://elasticsearch2:9100"] --elasticsearch.password=kibanaserver --elasticsearch.ssl.verificationMode=none --elasticsearch.username=kibanaserver

I hope it helps!

1 Like