FEHLER: [cat: Datei existiert nicht] Ich kann die Hadoop-Ausgabedatei in 14.04 nicht öffnen

FEHLER: [cat: Datei existiert nicht] Ich kann die Hadoop-Ausgabedatei in 14.04 nicht öffnen

Ich habe hadoop-1.0.3 auf meinem System (14.04) installiert, gefolgtdieses Tutorial.

Und ich führe erfolgreich ein Beispiel-MapReduce-Programm für die Wortanzahl wie folgt aus:

hadoopuser@arul-PC:/usr/local/hadoop$ bin/hadoop jar hadoop*examples*.jar wordcount /user/hadoopuser/SampleData /user/hadoopuser/SampleOutput
14/06/17 15:25:45 INFO input.FileInputFormat: Total input paths to process : 3
14/06/17 15:25:45 INFO util.NativeCodeLoader: Loaded the native-hadoop library
14/06/17 15:25:45 WARN snappy.LoadSnappy: Snappy native library not loaded
14/06/17 15:25:45 INFO mapred.JobClient: Running job: job_201406171444_0002
14/06/17 15:25:46 INFO mapred.JobClient:  map 0% reduce 0%
14/06/17 15:26:04 INFO mapred.JobClient:  map 66% reduce 0%
14/06/17 15:26:13 INFO mapred.JobClient:  map 100% reduce 0%
14/06/17 15:26:16 INFO mapred.JobClient:  map 100% reduce 22%
14/06/17 15:26:28 INFO mapred.JobClient:  map 100% reduce 100%
14/06/17 15:26:33 INFO mapred.JobClient: Job complete: job_201406171444_0002
14/06/17 15:26:33 INFO mapred.JobClient: Counters: 29
14/06/17 15:26:33 INFO mapred.JobClient:   Job Counters 
14/06/17 15:26:33 INFO mapred.JobClient:     Launched reduce tasks=1
14/06/17 15:26:33 INFO mapred.JobClient:     SLOTS_MILLIS_MAPS=33037
14/06/17 15:26:33 INFO mapred.JobClient:     Total time spent by all reduces waiting after reserving slots (ms)=0
14/06/17 15:26:33 INFO mapred.JobClient:     Total time spent by all maps waiting after reserving slots (ms)=0
14/06/17 15:26:33 INFO mapred.JobClient:     Launched map tasks=3
14/06/17 15:26:33 INFO mapred.JobClient:     Data-local map tasks=3
14/06/17 15:26:33 INFO mapred.JobClient:     SLOTS_MILLIS_REDUCES=21208
14/06/17 15:26:33 INFO mapred.JobClient:   File Output Format Counters 
14/06/17 15:26:33 INFO mapred.JobClient:     Bytes Written=880838
14/06/17 15:26:33 INFO mapred.JobClient:   FileSystemCounters
14/06/17 15:26:33 INFO mapred.JobClient:     FILE_BYTES_READ=2214875
14/06/17 15:26:33 INFO mapred.JobClient:     HDFS_BYTES_READ=3671899
14/06/17 15:26:33 INFO mapred.JobClient:     FILE_BYTES_WRITTEN=3775759
14/06/17 15:26:33 INFO mapred.JobClient:     HDFS_BYTES_WRITTEN=880838
14/06/17 15:26:33 INFO mapred.JobClient:   File Input Format Counters 
14/06/17 15:26:33 INFO mapred.JobClient:     Bytes Read=3671523
14/06/17 15:26:33 INFO mapred.JobClient:   Map-Reduce Framework
14/06/17 15:26:33 INFO mapred.JobClient:     Map output materialized bytes=1474367
14/06/17 15:26:33 INFO mapred.JobClient:     Map input records=77931
14/06/17 15:26:33 INFO mapred.JobClient:     Reduce shuffle bytes=1207341
14/06/17 15:26:33 INFO mapred.JobClient:     Spilled Records=255966
14/06/17 15:26:33 INFO mapred.JobClient:     Map output bytes=6076101
14/06/17 15:26:33 INFO mapred.JobClient:     Total committed heap usage (bytes)=517210112
14/06/17 15:26:33 INFO mapred.JobClient:     CPU time spent (ms)=11530
14/06/17 15:26:33 INFO mapred.JobClient:     Combine input records=629172
14/06/17 15:26:33 INFO mapred.JobClient:     SPLIT_RAW_BYTES=376
14/06/17 15:26:33 INFO mapred.JobClient:     Reduce input records=102324
14/06/17 15:26:33 INFO mapred.JobClient:     Reduce input groups=82335
14/06/17 15:26:33 INFO mapred.JobClient:     Combine output records=102324
14/06/17 15:26:33 INFO mapred.JobClient:     Physical memory (bytes) snapshot=589725696
14/06/17 15:26:33 INFO mapred.JobClient:     Reduce output records=82335
14/06/17 15:26:33 INFO mapred.JobClient:     Virtual memory (bytes) snapshot=1862012928
14/06/17 15:26:33 INFO mapred.JobClient:     Map output records=629172

Wenn ich die Ausgabedatei überprüfe, ist sie im Ausgabeordner vorhanden.

hadoopuser@arul-PC:/usr/local/hadoop$ bin/hadoop dfs -ls /user/hadoopuser/SampleOutput
Found 3 items
-rw-r--r--   1 hadoopuser supergroup          0 2014-06-17 15:26 /user/hadoopuser/SampleOutput/_SUCCESS
drwxr-xr-x   - hadoopuser supergroup          0 2014-06-17 15:25 /user/hadoopuser/SampleOutput/_logs

-rw-r--r-- 1 hadoopuser-Supergruppe 880838 17.06.2014 15:26 /Benutzer/hadoopuser/SampleOutput/part-r-00000

Ich habe versucht, es mit dem folgenden Befehl zu öffnen:

hadoopuser@avvenire-PC:/usr/local/hadoop$ bin/hadoop dfs -cat /user/hadoopuser/SampleOutput/part-r-0000

Aber ich erhalte das folgende Ergebnis:

cat: File does not exist: /user/hadoopuser/SampleOutput/part-r-0000

Bitte bieten Sie mir eine Lösung an. Vielen Dank im Voraus.

Antwort1

Überprüfen Sie den Dateinamen. Er besteht aus fünf Nullen, nicht aus vier.

bin/hadoop dfs -cat /Benutzer/hadoopuser/SampleOutput/part-r-00000

Antwort2

Mir ist klar, dass bereits eine Antwort akzeptiert wurde, aber hier ist die Lösung, die mir passiert ist (nur für den Fall, dass jemand anders diesen Thread sieht).


TLDR: Stellen Sie sicher, dass Ihr Hadoop-Verzeichnis keine widersprüchlichen Ordnernamen enthält (bei mir war es /usr/local/hadoop).

Als ich die Ausgabe generierte, legte ich sie in einen Ordner namens output/. Vor diesem Programm hatte ich jedoch ein anderes, das auch in output schrieb, und ich hatte die Ausgabedaten in einem Ordner namens output in meinem Hadoop-Verzeichnis gespeichert. Dies verursachte Probleme für mich, denn obwohl dieser Ordner beim Ausführen von nicht angezeigt wurde bin/hadoop fs -ls, suchte der Befehl bin/hadoop fs -cat output/*tatsächlich in dem Ordner, den ich zuvor generiert hatte, statt in der Ausgabe des Programms, das ich gerade ausgeführt hatte. Nachdem ich dieses Ausgabeverzeichnis mit gelöscht hatte rm -rf output/, war das Problem behoben.

verwandte Informationen