# Couldnt connect to host ElasticSearch down?

**URL:** <https://discuss.elastic.co/t/couldnt-connect-to-host-elasticsearch-down/55852>\
**Category:** Elasticsearch\
**Created:** [July 19, 2016, 10:00am UTC](https://discuss.elastic.co/t/couldnt-connect-to-host-elasticsearch-down/55852 "2016-07-19T10:00:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bharatbhushan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bharatbhushan/32/10960_2.png) [@bharatbhushan](https://discuss.elastic.co/u/bharatbhushan)\
**Post date:** [July 19, 2016, 10:00am UTC](https://discuss.elastic.co/t/couldnt-connect-to-host-elasticsearch-down/55852/1 "2016-07-19T10:00:36Z")

</div>

Hi All,

I face a problem to insert data into ElasticsSearch sometimes and i catch the exception is "Couldnt connect to host[ip address] , ElasticSearch down?". I am using ElasticSearch version is "1.7.5". and i am using php ElasticSearch client

cluster detail is 1 master node and 3 data node.  
Master node ( 4 cpu, 13G Ram, 8G used Ram )  
Data node 1 ( 4 cpu, 27G Ram, 25G used Ram )  
Data node 2 ( 4 cpu, 27G Ram, 26G used Ram )  
Data node 3 ( 4 cpu, 27G Ram, 26G used Ram )

Please help me out from this problem.

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [July 19, 2016, 1:20pm UTC](https://discuss.elastic.co/t/couldnt-connect-to-host-elasticsearch-down/55852/2 "2016-07-19T13:20:01Z")

</div>

Can you paste the exception message, the relevant initialization code of your PHP client, and the addresses of your nodes?

---

<div class="post-metadata">

**Author:** ![bharatbhushan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bharatbhushan/32/10960_2.png) [@bharatbhushan](https://discuss.elastic.co/u/bharatbhushan)\
**Post date:** [July 19, 2016, 1:45pm UTC](https://discuss.elastic.co/t/couldnt-connect-to-host-elasticsearch-down/55852/3 "2016-07-19T13:45:37Z")

</div>

First of all thanks for reply.

$attribute=array("35411" =\> "2016-07-19T00:04:23", "35413" =\> "2016-07-19T00:04:23");

try {  
$ElasticSearchConnection = \ElasticSearch\Client::connection(array( 'servers' =\> 127.0.0.1, 'protocol' =\> 'http', 'type' =\> 'typeName', 'index' =\> 'indexName'));  
$ElasticSearchConnection-\>index($attribute, 1);  
} catch (Exception $ex) {  
print\_r($ex-\>getMessage());  
}

**exception message** is Couldnt connect to host [127.0.0.1], ElasticSearch down?

Please provide the best solution

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [July 19, 2016, 2:16pm UTC](https://discuss.elastic.co/t/couldnt-connect-to-host-elasticsearch-down/55852/4 "2016-07-19T14:16:56Z")

</div>

Can you confirm Elasticsearch is running locally? What's the output of:

```auto
curl -XGET 127.0.0.1:9200

```

Maybe you need to specify the port in the 'servers' parameter? Perhaps open an issue with the author of your client and ask there?

---

<div class="post-metadata">

**Author:** ![bharatbhushan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bharatbhushan/32/10960_2.png) [@bharatbhushan](https://discuss.elastic.co/u/bharatbhushan)\
**Post date:** [July 20, 2016, 5:25am UTC](https://discuss.elastic.co/t/couldnt-connect-to-host-elasticsearch-down/55852/5 "2016-07-20T05:25:19Z")

</div>

Actually i am using cluster on production but sometime its through exception "Couldnt connect to host , ElasticSearch down?"

I get message from RabbitMq Queue and then insert it into ElasticSearch but 5 % document not insert into ElasticSearch.

All ports are open.

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [July 20, 2016, 3:10pm UTC](https://discuss.elastic.co/t/couldnt-connect-to-host-elasticsearch-down/55852/6 "2016-07-20T15:10:33Z")

</div>

Do you have some logs from your production cluster? Can you reach the cluster via curl when the client is reporting failures?

The error sounds pretty explicit: it cannot connect to your cluster. So there's either a temporary network event which is preventing the client from connecting, or something on the cluster which is preventing connections (such as long-running GCs). Or potentially because the node it is trying to talk down has gone down for some reason.

---

<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:34pm UTC](https://discuss.elastic.co/t/couldnt-connect-to-host-elasticsearch-down/55852/7 "2017-07-05T22:34:01Z")

</div>


