xml - Hadoop:错误 conf.Configuration:解析 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>
推荐阅读
- r - 如何防止 R Shiny File Browser 将浏览器重置到页面顶部?
- qt - qdoc 不生成 HTML
- python - Google sheet API 导出/下载到 xlsx 并保存到 linux 服务器
- teamleader - 对合并请求的审查是否应该包括对代码风格的审查?
- button - 无法发送嵌入和组件 discord.js v13
- networking - 网络可视化(node_shape)
- javascript - 在网页中嵌入 Python IDE 并输出由 Python 代码生成的动画
- nginx - 你如何实现基本的nginx速率限制?
- javascript - 将 Google Sheet 的 v4 JSON Endpoint 与我的 API 一起使用,但仍然收到“未经授权”消息
- oauth-2.0 - 在自定义后端使用 Firebase 身份验证作为提供程序