我試圖做一個hadoop單節點安裝。Hadoop單節點安裝 - 格式錯誤 - 內容不被允許在序言中
我正在關注hadoop安裝說明文章this。有一個問題我需要做的步驟是使用命令
hduser @ DBSERVER格式化的Hadoop文件系統:〜/ Hadoop的/ conf目錄$ /家庭/ hduser/Hadoop的/ bin中/ Hadoop的NameNode的-format
[email protected]:~/hadoop/conf$ /home/hduser/hadoop/bin/hadoop namenode -format
12/02/06 18:24:31 INFO namenode.NameNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG: host = dbserver/127.0.1.1
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
************************************************************/
[Fatal Error] core-site.xml:6:1: Content is not allowed in prolog.
12/02/06 18:24:31 FATAL conf.Configuration: error parsing conf file: org.xml.sax.SAXParseException: Content is not allowed in prolog.
12/02/06 18:24:31 ERROR namenode.NameNode: java.lang.RuntimeException: org.xml.sax.SAXParseException: Content is not allowed in prolog.
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: Content is not allowed in prolog.
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/06 18:24:31 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at dbserver/127.0.1.1
************************************************************/
我試圖格式化
任何建議,以解決此問題,歡迎:)當出現上述錯誤消息。
核心-site.xml文件是在這裏,供大家參考@zensen
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
n: conf/core-site.xml -->
<property>
<name>hadoop.tmp.dir</name>
<value>/app/hadoop/tmp</value>
<description>A base for other temporary directories.</description>
</property>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:54310</value>
<description>The name of the default file system. A URI whose
scheme and authority determine the FileSystem implementation. The
uri's scheme determines the config property (fs.SCHEME.impl) naming
the FileSystem implementation class. The uri's authority is used to
determine the host, port, etc. for a filesystem.</description>
</property><configuration>
〜
感謝蓁蓁您的寶貴線索。我在ubuntu終端中使用VI編輯器,並且在<?xml之前沒有看到任何字符? – Nik 2012-02-06 23:49:41
問題解決了。這是core-site.xml文件中的格式錯誤。請接受我的感謝,感謝您的幫助。 – Nik 2012-02-07 00:02:40
沒問題。有困難的時候第一次設置它也是:)以後的通知:你可以上傳你喜歡的答案並將其標記爲「接受」(兩個選項都在每個答案旁邊)。 – 2012-02-07 00:10:17