有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

爪哇正在得到亚恩斯泰。在mac os上配置hadoop namenode时发生xml错误

我正在尝试将我的mac配置为hadoop namenode。键入此命令后:

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 "<!--".

但是纱线网站。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>

如有任何建议,将不胜感激


共 (1) 个答案

  1. # 1 楼答案

    这里有一个小错误:

    <!-—
    

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

    <! 
    

    因此,更正后的文档是(我使用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>