【问题标题】:Content of FSIMAGE and EDIT files in Hadoop command errorHadoop 命令错误中 FSIMAGE 和 EDIT 文件的内容
【发布时间】:2023-03-15 21:39:01
【问题描述】:

我使用的是 Hadoop 2.2.0 版本。我想查看“FSIMAGE”和“EDITS”文件的内容。我使用了以下命令:

bin/hdfs oiv -i fsimage -o fsimage.txt

bin/hdfs oev -i 编辑 -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”文件已创建,但它是空的。

可能是什么问题或我如何查看这些文件的内容?

【问题讨论】:

    标签: java hadoop hdfs


    【解决方案1】:

    就像您当前的工作目录是 /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]#
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多