# Unable to retrieve version information from Elasticsearch nodes. connect ECONNREFUSED 127.0.0.1:9200

**URL:** <https://discuss.elastic.co/t/unable-to-retrieve-version-information-from-elasticsearch-nodes-connect-econnrefused-127-0-0-1-9200/305585>\
**Category:** Kibana\
**Tags:** elastic-stack-security, docker\
**Created:** [May 25, 2022, 9:57am UTC](https://discuss.elastic.co/t/unable-to-retrieve-version-information-from-elasticsearch-nodes-connect-econnrefused-127-0-0-1-9200/305585 "2022-05-25T09:57:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![devikingno](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/devikingno/32/105682_2.png) [@devikingno](https://discuss.elastic.co/u/devikingno)\
**Post date:** [May 25, 2022, 9:57am UTC](https://discuss.elastic.co/t/unable-to-retrieve-version-information-from-elasticsearch-nodes-connect-econnrefused-127-0-0-1-9200/305585/1 "2022-05-25T09:57:02Z")

</div>

Hi everyone  
I'm trying setup SSL, TLS, HTTPS for my Elasticsearch and kibana container, 2 container ES and Kibana are all the same version (8.1.3) and run at localhost.  
I'm edited the configure host file locally in /etc/hosts path:

```auto
127.0.0.1 kibana.local logstash.local elastic.local localhost

```

I use "docker-compose up -d" and exec to ES container for create CA, certs.  
In /usr/share/Elasticsearch path i create new file with name "instance.yml":

```auto
instances:
  - name: 'elasticsearch'
    dns: ['elastic.local']
  - name: 'kibana'
    dns: ['kibana.local']
  - name: 'logstash'
    dns: ['logstash.local']

```

and i use command to create CA&cert:

```auto
bin/elasticsearch-certutil ca --pem --out config/certs/ca-cert.zip
unzip config/certs/ca-cert.zip
bin/elasticsearch-certutil cert --ca-cert /usr/share/elasticsearch/config/certs/ca/ca.crt --ca-key /usr/share/elasticsearch/config/certs/ca/ca.key --pem --days 3650 --in instance.yml --out config/certs/elastic-stack.zip
unzip config/certs/elastic-stack.zip

```

Inside "/usr/share/Elasticsearch/config/certs" path will have like this:

 ![Screen Shot 2022-05-25 at 4.38.21 PM](https://us1.discourse-cdn.com/elastic/original/3X/a/b/ab5ce992f75bce7d6f2a23abafa10c1a3ff99d29.png)

Here is my Elasticsearch.yml configure:

```auto
---
cluster.name: "docker-cluster"
network.host: 0.0.0.0

xpack.license.self_generated.type: basic
xpack.security.enabled: true

xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.key: certs/elasticsearch/elasticsearch.key
xpack.security.transport.ssl.certificate: certs/elasticsearch/elasticsearch.crt
xpack.security.transport.ssl.certificate_authorities: certs/ca/ca.crt

xpack.security.http.ssl.enabled: true
xpack.security.http.ssl.verification_mode: certificate
xpack.security.http.ssl.key: certs/elasticsearch/elasticsearch.key
xpack.security.http.ssl.certificate: certs/elasticsearch/elasticsearch.crt
xpack.security.http.ssl.certificate_authorities: certs/ca/ca.crt

```

And here is my kibana.yml configure:

```auto
---
server.name: kibana
server.host: kibana.local

elasticsearch.hosts: ["https://elastic.local:9200"]

elasticsearch.username: kibana_system
elasticsearch.password: ${KIBANA_SYSTEM_PASSWORD}

#xpack.security.enabled: true
server.ssl.enabled: true
server.ssl.certificate: /usr/share/kibana/config/certs/kibana.crt
server.ssl.key: /usr/share/kibana/config/certs/kibana.key
elasticsearch.ssl.certificateAuthorities: /usr/share/kibana/config/certs/ca/ca.crt

```

After that i restart 2 container ES and Kibana. I use command below here to test connect to Elasticsearch with https and ssl.

```auto
curl --cacert certs/ca/ca.crt -u elastic 'https://elastic.local:9200'

```

 ![Screen Shot 2022-05-25 at 4.49.51 PM](https://us1.discourse-cdn.com/elastic/original/3X/6/4/64265505bd03198ec88d7ca49352bc7655b751d2.png)

I success connect to ES with SSL and HTTPS but in kibana log i saw the error log:

```auto
Unable to retrieve version information from Elasticsearch nodes. connect ECONNREFUSED 127.0.0.1:9200

```

I try exec to kibana container and add "127.0.0.1 kibana.local logstash.local elastic.local localhost" to "/etc/hosts" path but Kibana still not working.  
It seems I am misunderstanding some step, can anyone here help me to solve this problem, I have tried searching but it does not bring me the desired results.  
Thanks all!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 22, 2022, 9:57am UTC](https://discuss.elastic.co/t/unable-to-retrieve-version-information-from-elasticsearch-nodes-connect-econnrefused-127-0-0-1-9200/305585/2 "2022-06-22T09:57:05Z")

</div>

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