복붙노트

[HADOOP] 하둡은 예 항아리를 사전 설치

HADOOP

하둡은 예 항아리를 사전 설치

난 그냥 성공적으로 내 로컬 컴퓨터에 하둡을 설정합니다. 난 그냥 구입 인기있는 책의 예제 중 하나를 다음입니다. 나는 설치와 함께 제공하는 모든 하둡 예제의 목록을 얻기 위해 노력하고 있어요. 나는 그렇게하려면 다음 명령을 입력합니다 :

bin/hadoop jar hadoop-*-examples.jar

나는이 들어가면 금방 하둡 예제의 목록을 해야하는 건가요? 그러나 내가 보는 모든이 오류 메시지는 다음과 같습니다

Not a valid JAR: /home/user/hadoop/hadoop-*-examples.jar

이 문제를 어떻게 해결합니까? 그것은 단순한 권한 문제인가?

해결법

  1. ==============================

    1.이것은 대부분의 아마 구성 문제 또는 잘못된 파일 경로를 사용합니다.

    이것은 대부분의 아마 구성 문제 또는 잘못된 파일 경로를 사용합니다.

    하둡의 대부분은 아마 이름 - * - examples.jar 때문에 하둡 내 버전 (1.0.0) 파일 이름이 하둡 - 예-1.0.0.jar입니다 올바르지 않습니다.

    그래서 나는 모든 사례를 나열하는 명령을 다음 실행 한 그것은 마법처럼 작동합니다 :

    bin/hadoop jar hadoop-examples-*.jar 
    
    An example program must be given as the first argument.
    Valid program names are:
      aggregatewordcount: An Aggregate based map/reduce program that counts the words in the input files.
      aggregatewordhist: An Aggregate based map/reduce program that computes the histogram of the words in the input files.
      dbcount: An example job that count the pageview counts from a database.
      grep: A map/reduce program that counts the matches of a regex in the input.
      join: A job that effects a join over sorted, equally partitioned datasets
      multifilewc: A job that counts words from several files.
      pentomino: A map/reduce tile laying program to find solutions to pentomino problems.
      pi: A map/reduce program that estimates Pi using monte-carlo method.
      randomtextwriter: A map/reduce program that writes 10GB of random textual data per node.
      randomwriter: A map/reduce program that writes 10GB of random data per node.
      secondarysort: An example defining a secondary sort to the reduce.
      sleep: A job that sleeps at each map and reduce task.
      sort: A map/reduce program that sorts the data written by the random writer.
      sudoku: A sudoku solver.
      teragen: Generate data for the terasort
      terasort: Run the terasort
      teravalidate: Checking results of terasort
      wordcount: A map/reduce program that counts the words in the input files.
    

    내가 당신과 동일한 파일 이름 패턴을 사용 또한 경우에 나는 오류가 발생했습니다 :

    bin/hadoop jar hadoop-*examples.jar 
    
    Exception in thread "main" java.io.IOException: Error opening job jar: hadoop-*examples.jar
    

    HTH

  2. ==============================

    2.당신은 당신이 사용하고자하는 jar 파일의 클래스 이름을 지정해야합니다 :

    당신은 당신이 사용하고자하는 jar 파일의 클래스 이름을 지정해야합니다 :

    hadoop jar pathtojarfile classname arg1 arg2 ..
    

    예:

    hadoop jar example.jar wordcount inputPath outputPath
    
  3. ==============================

    3.@Anup. jar 파일의 전체 / 상대 경로가 필요합니다.

    @Anup. jar 파일의 전체 / 상대 경로가 필요합니다.

    귀하의 경우는 /home/user/hadoop/share/hadoop-*-examples.jar 수 있습니다

    하둡의 디렉토리에서 전체 명령이있을 수 있습니다

    / 가정 / 사용자 / 하둡 / 빈 / 하둡 /home/user/hadoop/share/hadoop-*-examples.jar

    (내가 거기 절대 전체 경로를 사용하지만, 당신은 상대 경로를 사용할 수 있습니다).

  4. ==============================

    4.당신이 $ HADOOP_HOME / 주 / 하둡 / 맵리 듀스 / 하둡의 항아리를 발견 할 것이다 - * - 예 * .JAR

    당신이 $ HADOOP_HOME / 주 / 하둡 / 맵리 듀스 / 하둡의 항아리를 발견 할 것이다 - * - 예 * .JAR

  5. from https://stackoverflow.com/questions/18808895/hadoop-preinstalled-example-jars by cc-by-sa and MIT license