xml - Hadoop:ERROR conf.Configuration:解析conf core-site.xml时出错

标签 xml hadoop

尝试设置单节点系统并在运行时出现此错误

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>

关于xml - Hadoop:ERROR conf.Configuration:解析conf core-site.xml时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52100010/

相关文章:

javascript - document.getElementsByName() 不是 Firefox 中的函数

mysql - --direct 模式如何在 sqoop 中工作?

hadoop - 在hadoop中,如何分别验证每个从节点上运行的map任务数?

azure - Cloudera on cloud (Azure) 架构说明

c# - 发生 System.Xml.XmlException。名称不能以 'G' 字符、十六进制值 0xFF27 开头。 44 号线,位置 4

Android Studio 如何制作一个 2 列的 LinearLayout

c# - .NET Xml 序列化程序可选属性

hadoop - 外壳程序异常java类型java.lang.Integer无法为此数据存储区映射

java - 将tsv导入到hbase中时出错

c# - XDocument.Root.Element 返回 null