简体   繁体   中英

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

Trying to set up a single-node system and am getting this error when running

hadoop jar HadoopWordCount.jar HadoopWordCount input.txt output

from the command line. and getting the following error. Input, output, and jar file are all in the same directory.

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"]

Runs perfectly in IntelliJ but assignment calls for the command line. Below is the core-site.xml file.

<?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>

property tag should be within configuration tag

<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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM