1

ローカル マシンで Hadoop のセットアップに成功しました。購入したばかりの人気のある本の例の 1 つに従っています。インストールに付属するすべての Hadoop サンプルのリストを取得しようとしています。そのために、次のコマンドを入力します。

bin/hadoop jar hadoop-*-examples.jar

これを入力すると、Hadoop の例のリストが表示されるはずですよね? ただし、表示されるのは次のエラー メッセージだけです。

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

この問題を解決するにはどうすればよいですか? 単純な許可の問題ですか?

4

4 に答える 4

0

これはおそらく、設定の問題か、無効なファイル パスの使用です。

私のバージョンの Hadoop (1.0.0) ではファイル名が hadoop-examples-1.0.0.jar であるため、おそらく hadoop-*-examples.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

于 2013-09-15T10:57:19.190 に答える