# Elasticsearch and CDH 5.4 Installation

**URL:** https://discuss.elastic.co/t/elasticsearch-and-cdh-5-4-installation/35084
**Category:** Elasticsearch
**Tags:** es-hadoop
**Created:** [November 19, 2015, 8:36pm UTC](https://discuss.elastic.co/t/elasticsearch-and-cdh-5-4-installation/35084 "2015-11-19T20:36:50Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![anantraman](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@anantraman](https://discuss.elastic.co/u/anantraman)
#### Post date: [November 19, 2015, 8:36pm UTC](https://discuss.elastic.co/t/elasticsearch-and-cdh-5-4-installation/35084/1 "2015-11-19T20:36:50Z")

</div>

I have a 1 node (Psuedo Cluster) CDH 5.4 with the latest version of the ES. I have downloaded the es-hadoop as well. What do I need to do to link ES and es-hadoop? I don't understand the installation instructions at the github. Thanks!

---

<div class="post-metadata">

### Author: ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)
#### Post date: [November 23, 2015, 9:48pm UTC](https://discuss.elastic.co/t/elasticsearch-and-cdh-5-4-installation/35084/2 "2015-11-23T21:48:05Z")

</div>

The maybe the [reference documentation](https://www.elastic.co/guide/en/elasticsearch/hadoop/current/index.html), linked in the `README` will help.

---

<div class="post-metadata">

### Author: ![anantraman](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@anantraman](https://discuss.elastic.co/u/anantraman)
#### Post date: [December 14, 2015, 7:34pm UTC](https://discuss.elastic.co/t/elasticsearch-and-cdh-5-4-installation/35084/3 "2015-12-14T19:34:25Z")

</div>

Here is my first attempt at a Map Reduce with Input in ES and Output in HDFS.

HADOOP\_CLASSPATH=/home/anant/Documents/jarfiles:/opt/esh/dist/

```
conf.set("es.nodes","<hostname>:9200");
conf.set("es.resource",args[0]);
job.setInputFormatClass(EsInputFormat.class);

```

hadoop jar mrinpes.jar MRInpES temperature/logs output -libjars elasticsearch-hadoop-mr-2.1.2.jar

mrinpes.jar is in the 1st directory and elastic-hadoop jars are in the 2nd directory of the HADOOP\_CLASSPATH

I still get the error: Exception in thread "main" java.lang.NoClassDefFoundError: org/elasticsearch/hadoop/mr/EsInputFormat

Searching the elasticsearch jar file...The class file is there...  
[anant@psvc01nodecdh4 jarfiles]$ jar tvf /opt/esh/dist/elasticsearch-hadoop-mr-2.1.2.jar | grep "EsInputFormat"  
2068 Thu Oct 29 17:47:36 MST 2015 org/elasticsearch/hadoop/mr/EsInputFormat$AbstractWritableShardRecordReader.class  
1867 Thu Oct 29 17:47:36 MST 2015 org/elasticsearch/hadoop/mr/EsInputFormat$JsonWritableShardRecordReader.class  
3676 Thu Oct 29 17:47:36 MST 2015 org/elasticsearch/hadoop/mr/EsInputFormat$ShardInputSplit.class  
9248 Thu Oct 29 17:47:36 MST 2015 org/elasticsearch/hadoop/mr/EsInputFormat$ShardRecordReader.class  
3336 Thu Oct 29 17:47:36 MST 2015 org/elasticsearch/hadoop/mr/EsInputFormat$WritableShardRecordReader.class  
7199 Thu Oct 29 17:47:36 MST 2015 org/elasticsearch/hadoop/mr/EsInputFormat.class

The Hadoop version:

[anant@psvc01nodecdh4 jarfiles]$ hadoop version  
Hadoop 2.6.0-cdh5.4.5  
Subversion [http://github.com/cloudera/hadoop](http://github.com/cloudera/hadoop) -r ab14c89fe25e9fb3f9de4fb852c21365b7c5608b  
Compiled by jenkins on 2015-08-12T21:12Z  
Compiled with protoc 2.5.0  
From source with checksum d31cb7e46b8602edaf68d335b785ab  
This command was run using /usr/lib/hadoop/hadoop-common-2.6.0-cdh5.4.5.jar

Can anyone help me with this issue? What am I missing?

Thanks,  
Anant

---

<div class="post-metadata">

### Author: ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)
#### Post date: [December 18, 2015, 1:18pm UTC](https://discuss.elastic.co/t/elasticsearch-and-cdh-5-4-installation/35084/5 "2015-12-18T13:18:08Z")

</div>

You have not setup the classpath properly. `HADOOP_CLASSPATH` doesn't really work since many times it is computed automatically by the Hadoop scripts and thus it might be overwritten.

Do not that `libjars` only works if your code uses `GenericToolOptions` and `Tools` - if not, it's better to simply embed the jar within your own and thus not have to worry about it.

---

<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 6, 2017, 1:26pm UTC](https://discuss.elastic.co/t/elasticsearch-and-cdh-5-4-installation/35084/6 "2017-07-06T13:26:49Z")

</div>


