hadoop命令中fsimage和edit文件的内容错误

j91ykkif  于 2021-06-03  发布在  Hadoop
关注(0)|答案(1)|浏览(306)

我使用的是hadoop2.2.0版本。我想看看“fsimage”和“edits”文件的内容。我使用了以下命令:
bin/hdfs oiv-i fsimage-o fsimage.txt文件
bin/hdfs oev-i编辑-o编辑.xml
我是从aapche hadoop站点文档中了解到这些命令的。我运行了示例字数计算程序,然后尝试了上面的命令并得到了this:-

  1. rushi@ubuntu:/usr/local/hadoop$ bin/hdfs oiv -i fsimage -o fsimage.xml -p XML
  2. Exception in thread "main" java.lang.NullPointerException
  3. at org.apache.hadoop.hdfs.tools.offlineImageViewer.OfflineImageViewer.go(OfflineImageViewer.java:140)
  4. at org.apache.hadoop.hdfs.tools.offlineImageViewer.OfflineImageViewer.main(OfflineImageViewer.java:260)

“fsimage.xml”文件已创建,但为空。
可能有什么问题?如何查看这些文件的内容?

vjhs03f7

vjhs03f71#

您当前的工作目录是/usr/local/hadoop。我怀疑文件fsimage在direcotry中不存在,而oiv类找不到它。

  1. > [root@hdm1 current]# hdfs oiv -i fsimage -o /tmp/a Exception in thread
  2. > "main" java.lang.NullPointerException at
  3. > org.apache.hadoop.hdfs.tools.offlineImageViewer.OfflineImageViewer.go(OfflineImageViewer.java:140)
  4. > at
  5. > org.apache.hadoop.hdfs.tools.offlineImageViewer.OfflineImageViewer.main(OfflineImageViewer.java:260)

使用fsimage文件的完整路径的示例

  1. > [root@hdm1 current]# hdfs oiv -i /data/nn/dfs/name/current/fsimage_0000000000000002415 -o
  2. > /tmp/fsimage.txt
  3. > [root@hdm1 current]#

相关问题