Проблема с установкой Hadoop Ubuntu 18.04: hadoop namenode -format error - PullRequest
0 голосов
/ 12 октября 2018

Я пытаюсь выполнить установку hadoop.

Я следую этой статье за инструкциями по установке hadoop.Один из шагов, которые мне нужно сделать, - отформатировать файловую систему hadoop с помощью команды:

root @ ben-Aspire-E5-575G: ~ # hadoop namenode -format

Я получил следующую ошибку

2018-10-12 00:08:16,884 INFO namenode.NameNode: registered UNIX signal handlers for [TERM, HUP, INT]
2018-10-12 00:08:16,896 INFO namenode.NameNode: createNameNode [-format]
2018-10-12 00:08:17,024 ERROR conf.Configuration: error parsing conf hdfs-site.xml
com.ctc.wstx.exc.WstxEOFException: Unexpected EOF; was expecting a close tag for element <xml>
 at [row,col,system-id]: [49,0,"file:/usr/local/hadoop/etc/hadoop/hdfs-site.xml"]
	at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:687)
	at com.ctc.wstx.sr.BasicStreamReader.throwUnexpectedEOF(BasicStreamReader.java:5608)
	at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2802)
	at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1123)
	at org.apache.hadoop.conf.Configuration$Parser.parseNext(Configuration.java:3257)
	at org.apache.hadoop.conf.Configuration$Parser.parse(Configuration.java:3063)
	at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2986)
	at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2926)
	at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2806)
	at org.apache.hadoop.conf.Configuration.set(Configuration.java:1366)
	at org.apache.hadoop.conf.Configuration.set(Configuration.java:1338)
	at org.apache.hadoop.conf.Configuration.setBoolean(Configuration.java:1679)
	at org.apache.hadoop.util.GenericOptionsParser.processGeneralOptions(GenericOptionsParser.java:339)
	at org.apache.hadoop.util.GenericOptionsParser.parseGeneralOptions(GenericOptionsParser.java:572)
	at org.apache.hadoop.util.GenericOptionsParser.<init>(GenericOptionsParser.java:174)
	at org.apache.hadoop.util.GenericOptionsParser.<init>(GenericOptionsParser.java:156)
	at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1587)
	at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1710)
2018-10-12 00:08:17,031 ERROR namenode.NameNode: Failed to start namenode.
java.lang.RuntimeException: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF; was expecting a close tag for element <xml>
 at [row,col,system-id]: [49,0,"file:/usr/local/hadoop/etc/hadoop/hdfs-site.xml"]
	at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:3003)
	at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2926)
	at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2806)
	at org.apache.hadoop.conf.Configuration.set(Configuration.java:1366)
	at org.apache.hadoop.conf.Configuration.set(Configuration.java:1338)
	at org.apache.hadoop.conf.Configuration.setBoolean(Configuration.java:1679)
	at org.apache.hadoop.util.GenericOptionsParser.processGeneralOptions(GenericOptionsParser.java:339)
	at org.apache.hadoop.util.GenericOptionsParser.parseGeneralOptions(GenericOptionsParser.java:572)
	at org.apache.hadoop.util.GenericOptionsParser.<init>(GenericOptionsParser.java:174)
	at org.apache.hadoop.util.GenericOptionsParser.<init>(GenericOptionsParser.java:156)
	at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1587)
	at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1710)
Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF; was expecting a close tag for element <xml>
 at [row,col,system-id]: [49,0,"file:/usr/local/hadoop/etc/hadoop/hdfs-site.xml"]
	at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:687)
	at com.ctc.wstx.sr.BasicStreamReader.throwUnexpectedEOF(BasicStreamReader.java:5608)
	at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2802)
	at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1123)
	at org.apache.hadoop.conf.Configuration$Parser.parseNext(Configuration.java:3257)
	at org.apache.hadoop.conf.Configuration$Parser.parse(Configuration.java:3063)
	at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2986)
	... 11 more
2018-10-12 00:08:17,035 INFO util.ExitUtil: Exiting with status 1: java.lang.RuntimeException: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF; was expecting a close tag for element <xml>
 at [row,col,system-id]: [49,0,"file:/usr/local/hadoop/etc/hadoop/hdfs-site.xml"]
2018-10-12 00:08:17,043 INFO namenode.NameNode: SHUTDOWN_MSG: 
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at ben-Aspire-E5-575G/127.0.1.1
************************************************************/

файл hdfs-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>

        <property>

                <name>dfs.replication</name>

                        <value>1</value>

                        <description>Default block replication.The actual number of replications can be specified when the file is created. The default is used if replication is not specified in create t$

        </property>

        <property>

                <name>dfs.namenode.name.dir</name>

                <value>file:/usr/local/hadoop_store/hdfs/namenode</value>

        </property>

        <property>

                <name>dfs.datanode.data.dir</name>

                <value>file:/usr/local/hadoop_store/hdfs/datanode</value>

        </property>

</configuration>

Ответы [ 2 ]

0 голосов
/ 12 октября 2018

Вам не хватает как </description>, так и окончательного </xml> за пределами тега конечной конфигурации в предоставленном вами файле.

Как говорится в ошибке, отсутствует тег.

Описание является необязательным, поэтому вы можете полностью удалить этот тег

0 голосов
/ 12 октября 2018

Я думаю, вы должны исправить тег "description".Нет правильного конца.

...