java - 在 mac os 上配置 hadoop namenode 时出现 yarn-site.xml 错误

标签 java xml macos hadoop

我正在尝试将我的 mac 配置为 hadoop 名称节点。输入此命令后:

bin/hdfs namenode -format

我收到这个错误:

[Fatal Error] yarn-site.xml:3:4: Comment must start with "<!--".
15/12/28 20:32:06 FATAL conf.Configuration: error parsing conf yarn-site.xml
org.xml.sax.SAXParseException; systemId: file:/Library/hadoop-2.7.1/etc/hadoop/yarn-site.xml; 
lineNumber: 3; columnNumber: 4; Comment must start with "<!--".

但是 yarn-site.xml 文件有那个注释。这是该文件的内容:

<?xml version="1.0"?>
<?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>
    <property>
        <name>yarn.nodemanager.aux-services</name>
        <value>mapreduce_shuffle</value>
    </property>
</configuration>

任何建议将不胜感激。

最佳答案

这里有个小错误:

<!-—

这应该是(注意第二个“-”。您需要将“—”替换为“-”):

<!--

所以更正后的文档是(我使用 XMLValidator 对其进行了验证:http://www.xmlvalidation.com/)

<?xml version="1.0"?>
<?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>
    <property>
        <name>yarn.nodemanager.aux-services</name>
        <value>mapreduce_shuffle</value>
    </property>
</configuration>

关于java - 在 mac os 上配置 hadoop namenode 时出现 yarn-site.xml 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34504140/

相关文章:

swift - macOS/swift 使用 AVCaptureSession 捕获音频

java - 正则表达式与偶尔的字符串包装器分割线 - 无法理解正则表达式

java - 返回 arrayList 时遇到问题

XMLStarlet 不删除元素

java.lang.IllegalStateException : Could not find method btnSubmit(View) in a parent or ancestor Context for android:onClick

java - DOM4J 文档 : read an ISO-8859-1 xml

asp.net-mvc - 使用OSX开发ASP.NET MVC项目的Web设计人员的解决方案?

java - 打印百分比的程序中的 UnknownFormatConversionException

java - 在Java中获取图像质量与ImageMagick的 "identify"命令相同

macos - Growl 1.3 在沙盒 Cocoa 应用程序中的使用