2015-11-12 35 views
0

錯誤消息我得到了在運行的Hadoop的NameNode -format:如何在ubuntu 14.04中用Apache spark解決以下致命錯誤?

[Fatal Error] core-site.xml:8:5: The element type "property" must be terminated by the matching end-tag "</property>". 
15/11/12 14:53:07 FATAL conf.Configuration: error parsing conf file: org.xml.sax.SAXParseException; systemId: file:/home/administrator/Downloads/FlareGet/Compressed/hadoop/conf/core-site.xml; lineNumber: 8; columnNumber: 5; The element type "property" must be terminated by the matching end-tag "</property>". 
15/11/12 14:53:07 ERROR namenode.NameNode: java.lang.RuntimeException: org.xml.sax.SAXParseException; systemId: file:/home/administrator/Downloads/FlareGet/Compressed/hadoop/conf/core-site.xml; lineNumber: 8; columnNumber: 5; The element type "property" must be terminated by the matching end-tag "</property>". 
    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:1250) 
    at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1267) 
    at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1288) 
Caused by: org.xml.sax.SAXParseException; systemId: file:/home/administrator/Downloads/FlareGet/Compressed/hadoop/conf/core-site.xml; lineNumber: 8; columnNumber: 5; The element type "property" must be terminated by the matching end-tag "</property>". 
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257) 
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:338) 
    at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:177) 
    at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1142) 
    ... 6 more 

15/11/12 14:53:07 INFO namenode.NameNode: SHUTDOWN_MSG: 
/************************************************************ 
SHUTDOWN_MSG: Shutting down NameNode at Lenovo-G580/127.0.1.1 
************************************************************/ 

我在覈心的site.xml代碼:

<?xml version="1.0"?> 
<configuration> 
     <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> 

所有標記已正確但錯誤仍然顯示,我無法弄清楚。請幫助。

回答

2

您的XML在第一個屬性中存在問題:標籤名稱已關閉兩次,並且從未打開過。應該是:

<property> 
      <name>hadoop.tmp.dir</name> 
      <value>/app/hadoop/tmp</value> 
      <description>A base for other temporary directories.</description> 
    </property> 
+0

檢查新編輯的代碼。這是目前的文件代碼,仍然給出相同的錯誤。 –

+1

您的帖子中的代碼中還存在相同的錯誤。你在我發佈的第二行中有兩個'':第一個必須是''。 – mgaido