# Connection error when selecting from ES table in Hive

**URL:** <https://discuss.elastic.co/t/connection-error-when-selecting-from-es-table-in-hive/86636>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [May 22, 2017, 9:17am UTC](https://discuss.elastic.co/t/connection-error-when-selecting-from-es-table-in-hive/86636 "2017-05-22T09:17:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bkard](https://avatars.discourse-cdn.com/v4/letter/b/dec6dc/32.png) [@bkard](https://discuss.elastic.co/u/bkard)\
**Post date:** [May 22, 2017, 9:17am UTC](https://discuss.elastic.co/t/connection-error-when-selecting-from-es-table-in-hive/86636/1 "2017-05-22T09:17:28Z")

</div>

Hi all,

I've a problem with connecting ES to Hive.  
I have created an external table in Hive on ES index like this:

```
CREATE EXTERNAL TABLE es_hive_test(
    logger STRING,
    level STRING,
    streamer STRING)
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler'
TBLPROPERTIES('es.resource' = 'logs-2017.05.09/logs',
'es.nodes' = '10.8.120.185',  
'es.port' = '9200')

```

But when I try to select from the table I get the following error:

```
Failed with exception java.io.IOException:org.elasticsearch.hadoop.rest.EsHadoopNoNodesLeftException: 
Connection error (chck network and/or proxy settings)- all nodes failed; tried [[192.168.229.19:9200]]
Time taken: 0.467 seconds

```

Versions I'm using:  
ES: 5.2.2  
JDK: 1.8.0\_131  
Hadoop: 2.7.3  
Hive: 1.2.2

Both ES, Hadoop and Hive are running on the same machine.

These are the configurations in elasticearch.yml:

```
cluster.name: compass
bootstrap.memory_lock: false
network.host: 0.0.0.0
network.publish_host: ${ES_PUBLISH_HOST}
discovery.zen.ping.unicast.hosts: ${ES_HOSTS}
path.repo: "/usr/share/elasticsearch/backup"
cluster.routing.allocation.disk.watermark.low: 95%
cluster.routing.allocation.disk.watermark.high: 98%
discovery.zen.ping_timeout: 20s

```

Have read any other post here about it but can't figure out how to fix it.

Any suggestions?

---

<div class="post-metadata">

**Author:** ![shivam\_rastogi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shivam_rastogi/32/47660_2.png) [@shivam\_rastogi](https://discuss.elastic.co/u/shivam_rastogi)\
**Post date:** [May 25, 2017, 3:57pm UTC](https://discuss.elastic.co/t/connection-error-when-selecting-from-es-table-in-hive/86636/2 "2017-05-25T15:57:07Z")

</div>

Are you using X-pack with Elasticsearch ?

---

<div class="post-metadata">

**Author:** ![james.baiera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/james.baiera/32/10209_2.png) [@james.baiera](https://discuss.elastic.co/u/james.baiera)\
**Post date:** [May 25, 2017, 5:41pm UTC](https://discuss.elastic.co/t/connection-error-when-selecting-from-es-table-in-hive/86636/3 "2017-05-25T17:41:04Z")

</div>

Your Elasticsearch server is most likely returning that address as it's bound http address during the node discovery phase in the connector. Try enabling `es.nodes.wan.only` for your local development to disable the node discovery and filtering routines in the connector.

---

<div class="post-metadata">

**Author:** ![bkard](https://avatars.discourse-cdn.com/v4/letter/b/dec6dc/32.png) [@bkard](https://discuss.elastic.co/u/bkard)\
**Post date:** [June 13, 2017, 7:54am UTC](https://discuss.elastic.co/t/connection-error-when-selecting-from-es-table-in-hive/86636/4 "2017-06-13T07:54:00Z")

</div>

Thanks a lot!

---

<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 11, 2017, 7:54am UTC](https://discuss.elastic.co/t/connection-error-when-selecting-from-es-table-in-hive/86636/5 "2017-07-11T07:54:11Z")

</div>

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