Supermathie  
                
                  
                    February 27, 2020,  6:29pm
                   
                  1 
               
             
            
              follow-up to: Kibana docker list multiple ES hosts 
I have tried various values for this environment variable:
http://elasticsearch-1:9200,http://elasticsearch-2:9200,http://elasticsearch-3/9200
http://elasticsearch-1:9200 http://elasticsearch-2:9200 http://elasticsearch-3/9200
(http://elasticsearch-1:9200,http://elasticsearch-2:9200,http://elasticsearch-3/9200)
(http://elasticsearch-1:9200 http://elasticsearch-2:9200 http://elasticsearch-3/9200)
[http://elasticsearch-1:9200,http://elasticsearch-2:9200,http://elasticsearch-3/9200]
[http://elasticsearch-1:9200 http://elasticsearch-2:9200 http://elasticsearch-3/9200]
["http://elasticsearch-1:9200","http://elasticsearch-2:9200","http://elasticsearch-3:9200"]
- http://elasticsearch-1:9200 - http://elasticsearch-2:9200 - http://elasticsearch-3/9200
- http://elasticsearch-1:9200\n - http://elasticsearch-2:9200\n - http://elasticsearch-3/9200
All without success. Please, can you let us know?
Near as I can tell the correct separator is a space as it gives us this error:
FATAL  Error: "elasticsearch.hosts" setting was not applied. Check for spelling errors and ensure that expected plugins are installed.
instead of:
FATAL  ValidationError: child "elasticsearch" fails because [child "hosts" fails because [single value of "hosts" fails because ["hosts" must be a valid uri with a scheme matching the http|https pattern]]]
but still the mystery of the correct way to specify this to kibana (6.6.0) eludes me.
             
            
              1 Like 
            
            
           
          
            
              
                Supermathie  
              
                  
                    February 28, 2020,  5:15pm
                   
                  2 
               
             
            
              @Aaron_Caldwell  in the other topic  you suggested:
That syntax looks fine for kibana.yml but how do we express that as an environment variable? Adding an example to the actual documentation would be REALLY helpful.
             
            
              2 Likes 
            
            
           
          
            
            
              @Supermathie  have you tried ELASTICSEARCH_HOSTS='["http://....","http://..."]'  ?
             
            
              1 Like 
            
            
           
          
            
            
              That doesn't work either:
kibana             |  FATAL  ValidationError: child "elasticsearch" fails because [child "hosts" fails because [single value of "hosts" fails because ["hosts" must be a valid uri with a scheme matching the http|https pattern]]]
 
            
              
            
           
          
            
            
              @Supermathie  can you please be sure that you are not mistype any part of it?
  
  
    
  
  
    
    
      
        opened 08:25PM - 25 Jul 19 UTC 
      
        
          closed 08:20PM - 28 Aug 19 UTC 
        
      
     
    
        
          bug
         
        
          Team:Operations
         
        
          Feature:Configuration
         
    
   
 
  
    **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:** 
   
   
  
    
    
  
  
 
  
  
    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…
   
 
             
            
              
            
           
          
            
            
              Was support for this added in Kibana version 7? As specified in the OP I'm on 6.6.0.
             
            
              
            
           
          
            
            
              @Supermathie  I miss that part. I was confirming to the code and it looks like for our released docker artifacts it would only work starting on 6.6.1. Can you try with that version please?
             
            
              
            
           
          
            
              
                lcanas  
              
                  
                    March 24, 2020,  4:16pm
                   
                  8 
               
             
            
              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 
            
            
           
          
            
            
              Using docker.elastic.co/kibana/kibana:6.6.1 all of these variants fail:
      - ELASTICSEARCH_HOSTS='http://elasticsearch-1:9200,http://elasticsearch-2:9200,http://elasticsearch-3:9200'
      - ELASTICSEARCH_HOSTS='[http://elasticsearch-1:9200,http://elasticsearch-2:9200,http://elasticsearch-3:9200]'
      - ELASTICSEARCH_HOSTS='["http://elasticsearch-1:9200","http://elasticsearch-2:9200","http://elasticsearch-3:9200"]'
After some more digging I realized this value works (even on 6.6.0):
["http://elasticsearch-1:9200","http://elasticsearch-2:9200","http://elasticsearch-3:9200"]
which (due to escaping rules) must be specified on the command line as:
ELASTICSEARCH_HOSTS='["http://elasticsearch-1:9200","http://elasticsearch-2:9200","http://elasticsearch-3:9200"]'
or in docker-compose.yml as:
ELASTICSEARCH_HOSTS=["http://elasticsearch-1:9200","http://elasticsearch-2:9200","http://elasticsearch-3:9200"]
I had been specifying it using the former in docker-compose.yml which won't work since the appropriate quoting for that would be:
      - 'ELASTICSEARCH_HOSTS=["http://elasticsearch-1:9200","http://elasticsearch-2:9200","http://elasticsearch-3:9200"]'
 
            
              1 Like 
            
            
           
          
            
              
                system  
              
                  
                    April 24, 2020,  7:40pm
                   
                  10 
               
             
            
              This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.