# Elasticsearch could not connect

**URL:** <https://discuss.elastic.co/t/elasticsearch-could-not-connect/47972>\
**Category:** Elasticsearch\
**Created:** [April 20, 2016, 10:55pm UTC](https://discuss.elastic.co/t/elasticsearch-could-not-connect/47972 "2016-04-20T22:55:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![EricRogers](https://avatars.discourse-cdn.com/v4/letter/e/bc79bd/32.png) [@EricRogers](https://discuss.elastic.co/u/EricRogers)\
**Post date:** [April 20, 2016, 10:55pm UTC](https://discuss.elastic.co/t/elasticsearch-could-not-connect/47972/1 "2016-04-20T22:55:01Z")

</div>

So I've seen several posts about this however I'm in the same boat since upgrading from 1.x to 2.3.1

I've set my elasticsearch.yml to be blank and use all the defaults and I still get an issue connecting.

with a config setup:

[2016-04-20 23:38:44,323][WARN][transport.netty] [Elasticsearch] exception caught on transport layer [[id: 0x1a04f52d, /127.0.0.1:48126 =\> /127.0.0.1:9300]], closing connection  
java.lang.NullPointerException

with a blank config:  
[2016-04-20 23:38:44,323][WARN][transport.netty] [Bloodshed] exception caught on transport layer [[id: 0x18ad695a, /127.0.0.1:36462 =\> /127.0.0.1:9300]], closing connection  
java.lang.NullPointerException

I can curl localhost:9200  
erogers@napalprdlog03:/etc/elasticsearch$ curl localhost:9200

{  
"name" : "Elasticsearch-Log3",  
"cluster\_name" : "elasticsearch2",  
"version" : {  
"number" : "2.3.1",  
"build\_hash" : "bd980929010aef404e7cb0843e61d0665269fc39",  
"build\_timestamp" : "2016-04-04T12:25:05Z",  
"build\_snapshot" : false,  
"lucene\_version" : "5.5.0"  
},  
"tagline" : "You Know, for Search"  
}  
I cannot curl it's own internal ip address from the same box.

erogers@napalprdlog03:/etc/elasticsearch$ curl 10.220.7.19:9200  
curl: (7) Failed to connect to 10.220.7.19 port 9200: Connection refused

the purpose of this box is for external points to transmit via TCP windows event logs and other such log files.

I've tried setting network.host everywhich way but loose and it still will not allow 10.220.7.19:9200 to connect.

ufw has been disabled

---

<div class="post-metadata">

**Author:** ![abhijat](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@abhijat](https://discuss.elastic.co/u/abhijat)\
**Post date:** [April 20, 2016, 11:04pm UTC](https://discuss.elastic.co/t/elasticsearch-could-not-connect/47972/2 "2016-04-20T23:04:51Z")

</div>

This might help: [https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html). By default, it binds to and listens only on 127.0.0.1

---

<div class="post-metadata">

**Author:** ![EricRogers](https://avatars.discourse-cdn.com/v4/letter/e/bc79bd/32.png) [@EricRogers](https://discuss.elastic.co/u/EricRogers)\
**Post date:** [April 20, 2016, 11:18pm UTC](https://discuss.elastic.co/t/elasticsearch-could-not-connect/47972/3 "2016-04-20T23:18:56Z")

</div>

Yes I've set that in just about every possible way I could think.

this is how it's currently set.

network.host: _local_  
network.publish\_host: 10.220.7.19

---

<div class="post-metadata">

**Author:** ![abhijat](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@abhijat](https://discuss.elastic.co/u/abhijat)\
**Post date:** [April 21, 2016, 12:42am UTC](https://discuss.elastic.co/t/elasticsearch-could-not-connect/47972/4 "2016-04-21T00:42:02Z")

</div>

add `network.bind_host: 10.220.7.19`

and remove `network.host`

alternatively, set `network.host: ["_local_","10.220.7.19"]` and remove `network.publish_host`. You can retain it also if you like but it is just a duplicate IMO.

---

<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:** [July 5, 2017, 10:57pm UTC](https://discuss.elastic.co/t/elasticsearch-could-not-connect/47972/5 "2017-07-05T22:57:33Z")

</div>


