The Hortonworks Community Connection is now live. A completely rebuilt Q&A forum, Knowledge Base, Code Hub and more, backed by the experts in the industry.

You will be redirected here in 10 seconds. If your are not redirected, click here to visit the new site.

The legacy Hortonworks Forum is now closed. You can view a read-only version of the former site by clicking here. The site will be taken offline on January 31,2016

YARN Forum

Hadoop-examples jar

  • #43658
    Veerabahu
    Participant

    Where can I find the Hadoop examples.jar file ? Or Hadoop map reduce example jar.
    I don’t find it under /usr/lib/hadoop/lib and tried a find under root as well,
    I have HDP 2 installed thru Ambari ,Where can I find it, I wanted to run a sample map reduce word count job. Also would like to know the classes available in jar.

    Please advice

  • Author
    Replies
  • #43659
    abdelrahman
    Moderator

    Hi Sivagama,

    It is located in the following directory:
    /usr/lib/hadoop-mapreduce/
    you can run pi example by running the following from command line:

    hadoop jar /usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples-*.jar pi 10 10

    Thanks
    -Abdelrahman

    #79259
    Bin Xiong
    Participant

    Can anyone help?

    I just ran the following command in the sandbox and it did not work:

    <span style=”font-family: ‘Helvetica Neue’, Helvetica, Arial, ‘Open Sans’, ‘Lucida Grande’, sans-serif; font-size: 14.4px; line-height: 21.6px; background-color: #fbfbfb;”>hadoop jar /usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples-*.jar pi 10 10</span>

    The error is “Not a valid JAR: /usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples-*.jar

    <span style=”line-height: 1.5;”>”. And I could not find the subdir hadoop-mapreduce under /usr/lib/</span>

    [root@sandbox lib]# pwd

    /usr/lib

    [root@sandbox lib]# ls -l

    total 164

    drwxr-xr-x  3 root root  4096 2015-08-19 12:26 ambari-agent

    drwxr-xr-x  2 root root 12288 2015-08-19 12:27 ambari-metrics-collector

    drwxr-xr-x  2 root root  4096 2015-08-19 12:27 ambari-metrics-hadoop-sink

    drwxr-xr-x  3 root root  4096 2015-08-19 12:27 ambari-metrics-kafka-sink

    drwxr-xr-x  4 root root  4096 2015-08-19 12:18 ambari-server

    drwxr-xr-x  7 root root  4096 2015-08-19 12:27 ams-hbase

    drwxr-xr-x. 3 root root  4096 2015-08-19 12:08 anaconda-runtime

    drwxr-xr-x  8 root root  4096 2015-08-19 12:28 bigtop-tomcat

    drwxr-xr-x  2 root root  4096 2015-08-19 12:22 bigtop-utils

    drwxr-xr-x. 5 root root  4096 2015-08-19 12:18 ConsoleKit

    drwxr-xr-x  9 root root  4096 2015-08-19 12:15 cups

    drwxr-xr-x  4 root root  4096 2015-08-19 12:49 debug

    drwxr-xr-x  3 root root  4096 2015-08-19 12:27 flume

    dr-xr-xr-x. 2 root root  4096 2011-09-23 11:50 games

    drwxr-xr-x  3 root root  4096 2015-08-19 12:27 gcc

    drwxr-xr-x  9 hue  root  4096 2015-08-19 12:45 hue

    drwxr-xr-x  2 root root  4096 2015-07-23 17:46 java

    drwxr-xr-x  2 root root  4096 2015-07-23 17:46 java-1.3.1

    drwxr-xr-x  2 root root  4096 2015-07-23 17:46 java-1.4.0

    drwxr-xr-x  2 root root  4096 2015-07-23 17:46 java-1.4.1

    drwxr-xr-x  2 root root  4096 2015-07-23 17:46 java-1.4.2

    drwxr-xr-x  2 root root  4096 2015-07-23 17:46 java-1.5.0

     

    #81123
    Deepika G
    Participant

    Hi, When  I try to run the above mentioned command, im getting “Error: JAVA_HOME is not set and could not be found”. I have already set JAVA_HOME but on forum I found that we have to set in hadoop-env.sh file also. I could not find that file. I installed using ambari on docker.

    #81185
    Srinivas Aluri
    Participant

    @Bin Xiong : I think you are working on sandbox 2.x.  In 2.x examples.jar files are located in the following location : execute the command “find / -xdev -name hadoop-mapreduce-examples-*.jar”

    Finally run example using below command :

    hadoop jar /usr/hdp/2.3.2.0-2950/hadoop-mapreduce/hadoop-mapreduce-examples-*.jar pi 10 10.

The forum ‘YARN’ is closed to new topics and replies.

Support from the Experts

A HDP Support Subscription connects you experts with deep experience running Apache Hadoop in production, at-scale on the most demanding workloads.

Enterprise Support »

Become HDP Certified

Real world training designed by the core architects of Hadoop. Scenario-based training courses are available in-classroom or online from anywhere in the world

Training »

Hortonworks Data Platform
The Hortonworks Data Platform is a 100% open source distribution of Apache Hadoop that is truly enterprise grade having been built, tested and hardened with enterprise rigor.
Get started with Sandbox
Hortonworks Sandbox is a self-contained virtual machine with Apache Hadoop pre-configured alongside a set of hands-on, step-by-step Hadoop tutorials.
Modern Data Architecture
Tackle the challenges of big data. Hadoop integrates with existing EDW, RDBMS and MPP systems to deliver lower cost, higher capacity infrastructure.