簡體   English   中英

Hadoop:ERROR conf.Configuration:解析conf core-site.xml時出錯

[英]Hadoop: ERROR conf.Configuration: error parsing conf core-site.xml

嘗試設置單節點系統並在運行時出現此錯誤

hadoop jar HadoopWordCount.jar HadoopWordCount input.txt output

從命令行。 並得到以下錯誤。 輸入,輸出和jar文件都在同一目錄中。

2018-08-30 10:43:23,266 ERROR conf.Configuration: error parsing conf core-site.xml
com.ctc.wstx.exc.WstxParsingException: Illegal to have multiple roots (start tag in epilog?).
 at [row,col,system-id]: [22,2,"file:/usr/local/Cellar/hadoop/3.1.1/libexec/etc/hadoop/core-site.xml"]

在IntelliJ中完美運行,但是分配需要命令行。 以下是core-site.xml文件。

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License. See accompanying LICENSE file.
-->

<!-- Put site-specific property overrides in this file. -->

<configuration>
</configuration>

<property>
<name>hadoop.tmp.dir</name>
<value>/usr/local/Cellar/hadoop/hdfs/tmp</value>
<description>A base for other temporary directories.</description>
</property>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>

屬性標簽應在配置標簽內

<configuration> 
  <property> 
    <name>hadoop.tmp.dir</name> 
    <value>/usr/local/Cellar/hadoop/hdfs/tmp</value> 
    <description>A base for other temporary directories.</description> 
  </property> 
  <property>
    <name>fs.default.name</name>
    <value>hdfs://localhost:9000</value> 
  </property> 
</configuration>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM