美文网首页程序员数据中台-排坑
Windows格式化namenode报错 - ERROR nam

Windows格式化namenode报错 - ERROR nam

作者: 夹胡碰 | 来源:发表于2020-10-13 14:36 被阅读0次

环境

  • 操作系统: Windows 7
  • Hadoop版本: 2.6.0

问题描述

Windows执行hdfs namenode -format报如下错误

20/10/13 13:58:04 ERROR namenode.NameNode: Failed to start namenode.
java.lang.IllegalArgumentException: URI has an authority component
        at java.io.File.<init>(File.java:423)
        at org.apache.hadoop.hdfs.server.namenode.NNStorage.getStorageDirectory(NNStorage.java:336)
        at org.apache.hadoop.hdfs.server.namenode.FSEditLog.initJournals(FSEditLog.java:286)
        at org.apache.hadoop.hdfs.server.namenode.FSEditLog.initJournalsForWrite(FSEditLog.java:257)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:1190)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1655)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1782)
20/10/13 13:58:04 INFO util.ExitUtil: Exiting with status 1: java.lang.IllegalAr
gumentException: URI has an authority component
20/10/13 13:58:04 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at jfp/172.18.16.27
************************************************************/

问题原因

Windows环境下core-site.xml文件URI路径格式错误

  • 错误
<property>
    <name>hadoop.tmp.dir</name>
    <value>E:/soft_work/hadoop-2.6.0/data/hdfs</value>
</property>
  • 正确
<property>
    <name>hadoop.tmp.dir</name>
    <value>/E:/soft_work/hadoop-2.6.0/data/hdfs</value>
</property>

相关文章

网友评论

    本文标题:Windows格式化namenode报错 - ERROR nam

    本文链接:https://www.haomeiwen.com/subject/afyvpktx.html