【问题标题】:Getting Fatal Error while running bin/hadoop namenode -format运行 bin/hadoop namenode -format 时出现致命错误
【发布时间】:2012-03-15 01:16:22
【问题描述】:

运行 bin/hadoop namenode -format 时出现致命错误

使用Windows 7操作系统,在C:\cygwin\usr\local\hadoop-0.20.203.0\conf下编辑hadoop-env.sh文件,

#export JAVA_HOME=C:/Program Files/Java/jdk1.6.0_24
export JAVA_HOME=C:/jdk1.6.0_24.

我的 Java 类路径设置为 C:/jdk1.6.0_24

致命错误] hdfs-site.xml:5:2: 以下文件中的标记 根元素必须格式正确。

enter code here

$ bin/hadoop namenode -format
12/02/24 07:15:38 INFO namenode.NameNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG:   host = -PC/10.0.0.11
STARTUP_MSG:   args = [-format]
STARTUP_MSG:   version = 0.20.203.0
STARTUP_MSG:   build = http://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20-security-203 -r 1099333; compiled by 'oom' on Wed May  4 07:57:50 PDT 2011
************************************************************/

12/02/24 07:15:38 FATAL conf.Configuration: bad conf file: top-level element not <configuration>

12/02/24 07:15:38 WARN conf.Configuration: bad conf file: element not <property>

12/02/24 07:15:38 WARN conf.Configuration: bad conf file: element not <property>

[Fatal Error] hdfs-site.xml:5:2: The markup in the document following the root element must be well-formed.

12/02/24 07:15:38 FATAL conf.Configuration: error parsing conf file: org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.

12/02/24 07:15:38 ERROR namenode.NameNode: java.lang.RuntimeException: org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.

        at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1237)
        at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:1093)
        at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:1037)
        at org.apache.hadoop.conf.Configuration.set(Configuration.java:438)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.setStartupOption(NameNode.java:1124)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1141)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1162)

Caused by: org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.
        at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:249)
        at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:180)
        at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1142)
        ... 6 more

12/02/24 07:15:38 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at asoni-PC/10.0.0.11
************************************************************/

【问题讨论】:

    标签: java xml hadoop xmldocument


    【解决方案1】:

    看起来您的 hdfs-site.xml 中可能存在一些 XML 格式错误。看第 5 行。

    【讨论】:

    • 我正在关注下面的教程.. alans.se/blog/2010/hadoop-hbase-cygwin-windows-7-x64/#hadoop.我把 标签放在 hdfs-site.xml 中,它现在可以工作了。
    • 之前 ------------------ dfs.replication1 property> dfs.permissionsfalse ------------------ dfs.replication1dfs.permissionsfalse
    • 有人找到解决这个问题的方法了吗?
    • @Swamy :是的,通过更改 hdfs-site.xml 解决了这个问题。 dfs.replication1dfs.permissionsfalse
    • 你怎么知道它在第5行
    猜你喜欢
    • 1970-01-01
    • 2014-06-12
    • 1970-01-01
    • 2017-08-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-12
    • 1970-01-01
    相关资源
    最近更新 更多