# Elasticsearch for Apache Hadoop doesn't work

**URL:** <https://discuss.elastic.co/t/elasticsearch-for-apache-hadoop-doesnt-work/163971>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [January 12, 2019, 3:18am UTC](https://discuss.elastic.co/t/elasticsearch-for-apache-hadoop-doesnt-work/163971 "2019-01-12T03:18:14Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arthur\_Luz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arthur_luz/32/39719_2.png) [@Arthur\_Luz](https://discuss.elastic.co/u/Arthur_Luz)\
**Post date:** [January 12, 2019, 3:18am UTC](https://discuss.elastic.co/t/elasticsearch-for-apache-hadoop-doesnt-work/163971/1 "2019-01-12T03:18:15Z")

</div>

Hello, guys.

I need some help with Elasticsearch for Apache Hadoop connector.

I have on my environment a hortonworks hdp cluster and with hive. I need to create a external table for elasticsearch to move data from my hdfs to elasticsearch.

Ok, I followed elasticsearch documentation and I used Add jar command to import jars. Ok. it's fine.

But, when I try to create external table I receive this error: Error:

Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.RuntimeException: MetaException(message:java.lang.NoClassDefFoundError org/apache/commons/httpclient/Credentials) (state=08S01,code=1)

I'm using the version 3.1 of hdp cluster.

What I need to do to make this work?

can you help me?

Best regards!

---

<div class="post-metadata">

**Author:** ![Naveen\_R\_Vinayak](https://avatars.discourse-cdn.com/v4/letter/n/df705f/32.png) [@Naveen\_R\_Vinayak](https://discuss.elastic.co/u/Naveen_R_Vinayak)\
**Post date:** [January 22, 2019, 6:28pm UTC](https://discuss.elastic.co/t/elasticsearch-for-apache-hadoop-doesnt-work/163971/2 "2019-01-22T18:28:00Z")

</div>

Hi Arthur,  
Even I am facing the same issue. Did you find any solution for this?

Thanks

---

<div class="post-metadata">

**Author:** ![spagano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spagano/32/40136_2.png) [@spagano](https://discuss.elastic.co/u/spagano)\
**Post date:** [January 22, 2019, 8:58pm UTC](https://discuss.elastic.co/t/elasticsearch-for-apache-hadoop-doesnt-work/163971/3 "2019-01-22T20:58:54Z")

</div>

hi, i don't know but in new versions is necessary to do reference to commons-httpclient-3.0.1.jar

on the hive session:

**_add jar /your\_hdphome/hadoop/lib/commons-httpclient-3.0.1.jar;_**  
**_create external table etc etc_**

try doing this roadmap:

> [@Error: Unsupported/Unknown Elasticsearch version 6.X.X](https://discuss.elastic.co/t/error-unsupported-unknown-elasticsearch-version-6-x-x/164846/2):
>
> The problem was solved. The roadmap was the following: Use hive, no beeline. Just copy elasticsearch-hadoop-6.4.3.jar to all data nodes and masters on /{HDP\_HOME}/hadoop/lib/ (hortonworks to me) Create index and type on elasticsearch curl -X POST 'localhost:9200/bookindex/books' -H 'Content-Type: application/json' -d' { "bookId" : "A00-3", "author" : "Sankaran", "publisher" : "Mcgrahill", "name" : "how to get a job" } ' On hive always to do: hive\> add jar /usr/hdp/2.6.4.0-…

---

<div class="post-metadata">

**Author:** ![Arthur\_Luz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arthur_luz/32/39719_2.png) [@Arthur\_Luz](https://discuss.elastic.co/u/Arthur_Luz)\
**Post date:** [January 23, 2019, 12:36am UTC](https://discuss.elastic.co/t/elasticsearch-for-apache-hadoop-doesnt-work/163971/4 "2019-01-23T00:36:00Z")

</div>

Hi Sergio.

Thank you for you answer. I really appreciate it.

So, I try to do what you show above, but, the same error appear to me. 😕

I don't know but I think that this error is related to httpclient jar. The version of hortonworks hdp used in exemple is 2.6.4 and my is 3.1.0.

Maybe I need another jar to this version.

---

<div class="post-metadata">

**Author:** ![Naveen\_R\_Vinayak](https://avatars.discourse-cdn.com/v4/letter/n/df705f/32.png) [@Naveen\_R\_Vinayak](https://discuss.elastic.co/u/Naveen_R_Vinayak)\
**Post date:** [January 23, 2019, 11:18am UTC](https://discuss.elastic.co/t/elasticsearch-for-apache-hadoop-doesnt-work/163971/5 "2019-01-23T11:18:44Z")

</div>

Hi Sergio,

Thanks for the reply. Where can I download this jar? Seems that version of the jar is not available now.

---

<div class="post-metadata">

**Author:** ![Arthur\_Luz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arthur_luz/32/39719_2.png) [@Arthur\_Luz](https://discuss.elastic.co/u/Arthur_Luz)\
**Post date:** [January 23, 2019, 11:33am UTC](https://discuss.elastic.co/t/elasticsearch-for-apache-hadoop-doesnt-work/163971/6 "2019-01-23T11:33:51Z")

</div>

Hi, guys.

I solved the problem. Is the jar.

I followed the roadmap proposed by Sergio, but used this jar:

[https://mvnrepository.com/artifact/commons-httpclient/commons-httpclient/3.1.0.redhat-8](https://mvnrepository.com/artifact/commons-httpclient/commons-httpclient/3.1.0.redhat-8)

Now it's works.

Thank you very much, Sergio.

---

<div class="post-metadata">

**Author:** ![spagano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spagano/32/40136_2.png) [@spagano](https://discuss.elastic.co/u/spagano)\
**Post date:** [January 23, 2019, 1:52pm UTC](https://discuss.elastic.co/t/elasticsearch-for-apache-hadoop-doesnt-work/163971/7 "2019-01-23T13:52:53Z")

</div>

👍👍

---

<div class="post-metadata">

**Author:** ![kaduswapnali456](https://avatars.discourse-cdn.com/v4/letter/k/838e76/32.png) [@kaduswapnali456](https://discuss.elastic.co/u/kaduswapnali456)\
**Post date:** [January 28, 2019, 9:07am UTC](https://discuss.elastic.co/t/elasticsearch-for-apache-hadoop-doesnt-work/163971/8 "2019-01-28T09:07:59Z")

</div>

Hi sir,  
Thank you for the answer. we really appreciate your answer regarding [hadoop](https://crbtech.in/online-big-data-hadoop-training-course).

---

<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:** [February 25, 2019, 9:08am UTC](https://discuss.elastic.co/t/elasticsearch-for-apache-hadoop-doesnt-work/163971/9 "2019-02-25T09:08:00Z")

</div>

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