0

Can some one explain me this syntax ,

bin/hadoop jar hadoop*examples*.jar wordcount /user/hpuser/testHadoop /user/hpuser/testHadoop-output

Why are we using jar soon after bin/hadoop What does hadoop*examples*.jar means..? Do wordcount is name of the job, or we asking hadoop to count no of words..?

http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-single-node-cluster/

Surya
  • 3,408
  • 5
  • 27
  • 35

1 Answers1

2

Command Guide:

jar

Runs a jar file. Users can bundle their Map Reduce code in a jar file and execute it using this command.

Usage: hadoop jar <jar> [mainClass] args...

jar is the command. hadoop*examples*.jar is the jar file. WordCount is the main class. The rest are arguments passed to the WordCount.main() function:

public static void main(String[] args) throws Exception {
  int res = ToolRunner.run(new Configuration(), new WordCount(), args);
  System.exit(res);
}
Remus Rusanu
  • 288,378
  • 40
  • 442
  • 569
  • hadoop*examples*.jar is a single jar file or multiple jar files – Surya Jul 23 '13 at 07:23
  • why do we need SSH access for a new user ; why should it be able to connect to its own user account . – Surya Jul 23 '13 at 07:40
  • 1
    hadoop*examples* is a single file, the examples use `*` because the actual build artifact (file name) is specific to the build version (eg. `hadoop-examples-1.1.0-SNAPSHOT.jar`). The `*` will match your actual file name. Look into your HADOOP_HOME and you'll find this jar. – Remus Rusanu Jul 23 '13 at 08:17
  • For SSH, ask a different question as is unrelated to your original question. – Remus Rusanu Jul 23 '13 at 08:18
  • tanQ , here is the new post ; http://stackoverflow.com/questions/17805431/new-user-ssh-hadoop – Surya Jul 23 '13 at 08:47
  • 2
    Addendum to what Remus said - hadoop-example.jar also contains other MapReduce programs too like Pi-Estimator, not only the WordCount. – SSaikia_JtheRocker Jul 23 '13 at 09:22