我使用的是Hadoop 2.2.0版本。我想查看“FSIMAGE”和“EDITS”文件的内容。我使用了以下命令:
bin/hdfs oiv -i fsimage -o fsimage.txt
bin/hdfs oev -i edits -o edits.xml
我是从 Aapche hadoop site documentation 了解到这些命令的。我运行了示例字数统计程序,然后尝试了上面的命令并得到了这个:-
rushi@ubuntu:/usr/local/hadoop$ bin/hdfs oiv -i fsimage -o fsimage.xml -p XML
Exception in thread "main" java.lang.NullPointerException
at org.apache.hadoop.hdfs.tools.offlineImageViewer.OfflineImageViewer.go(OfflineImageViewer.java:140)
at org.apache.hadoop.hdfs.tools.offlineImageViewer.OfflineImageViewer.main(OfflineImageViewer.java:260)
“fsimage.xml”文件已创建,但它是空的。
可能是什么问题或者我如何查看这些文件的内容?
最佳答案
就像你当前的工作目录是/usr/local/hadoop。我怀疑文件 fsimage 在目录中不存在,并且 oiv 类无法找到它。
> [root@hdm1 current]# hdfs oiv -i fsimage -o /tmp/a Exception in thread
> "main" java.lang.NullPointerException at
> org.apache.hadoop.hdfs.tools.offlineImageViewer.OfflineImageViewer.go(OfflineImageViewer.java:140)
> at
> org.apache.hadoop.hdfs.tools.offlineImageViewer.OfflineImageViewer.main(OfflineImageViewer.java:260)
使用 FSIMAGE 文件的完整路径的示例
> [root@hdm1 current]# hdfs oiv -i /data/nn/dfs/name/current/fsimage_0000000000000002415 -o
> /tmp/fsimage.txt
> [root@hdm1 current]#
关于java - Hadoop命令错误中FSIMAGE和EDIT文件的内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21579884/