How can I run Hadoop run with a Java class?

前端 未结 9 803
甜味超标
甜味超标 2021-01-20 03:13

I am following the book Hadoop: the definitive Guide.

I am confused on example 3-1.

There is a Java source file, URLCat.java. I use javac to co

9条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-20 03:46

    step 1: Compile Java Program:

    javac URLCat.java -classpath $HADOOP_HOME/share/hadoop/common/hadoop-common-2.7.0.jar

    step 2: Create jar file :

    jar cvf URLCat.jar URLCat.class

    Step 3: Execute program : (mention your hdfs file location)

    hadoop jar URLCat.jar URLCat hdfs://localhost:9000/pcode/wcinput.txt

提交回复
热议问题