hadoop安装:无法启动namenode

b0zn9rqh  于 2021-05-30  发布在  Hadoop
关注(0)|答案(2)|浏览(400)

目前我正在尝试在我的ubuntu14.10(32位utopic)上安装hadoop-2.6.0。我按照这里的指示:
http://www.itzgeek.com/how-tos/linux/ubuntu-how-tos/install-apache-hadoop-ubuntu-14-10-centos-7-single-node-cluster.html#axzz3x2duwaxq
但是,尝试格式化namenode时无法启动namenode。
这是我在尝试使用hdfs或hadoop namenode格式时一直收到的消息:

15/04/11 16:32:13 FATAL namenode.NameNode: Fialed to start namenode
java.lang.IllegalArgumentException: URI has an authority component
    at java.io.File.<init>(File.java:423)
    at             org.apache.hadoop.hdfs.server.namenode.NNSStorage.getStorageDirectory(NNStorage.java:329)
    at
org.apache.hadoop.hdfs.server.namenode.FSEditLog.initJournals(FSEditLog.java: 270)
    at
org.apache.hadoop.hdfs.server.namenode.FSEditLog.initJournalsForWrite(FSEditLog.java:241)
    at     org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:935)
    at     org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1379)
    at     org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1504)
15/04/11 16:32:13 INFO util.ExitUtil: Exiting with status 1
15/04/11 16:32:14 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at ThinkPad-Edge-E540/127.0.1.1

************************************************************/

我是linux和hadoop的新手。请帮我解决这个问题。另外,当我第一次尝试安装hadoop时,收到如下错误消息:

java.net.ConnectException: Call From ThinkPad-Edge-E540/127.0.1.1 to localhost:9000 failed on connection exception: java.net.ConnectException: Connection refused; For more details see:  http://wiki.apache.org/hadoop/ConnectionRefused

稍后,我卸载了hadoop2.6.0,现在正尝试按照上面链接中所示的当前指令进行操作。
更新
我已经删除了以前版本中安装的所有java(jdk1.7.0)。但错误信息仍然存在。
更新
这是在我的etc/主机中显示的内容:

127.0.0.1 localhost
127.0.1.1 myname-mycomputer (I have commented out this line per suggestion)

# The following lines are desirable for IPv6 capable hosts

::1       ip6-localhost  ip6-loopback
fe00::0   ip6-localnet
ff00:0    ip6-mcastprefix
ff02::1   ip6-allnodes
ff02::2   ip6-allrouters
g52tjvyc

g52tjvyc1#

当我在hdfs-site.xml中为namenode和datanode指定了错误的路径,在core-site.xml中为tmp dir path指定了错误的路径时,就会出现此问题,路径的格式应该正确,例如-

<property>
    <name>dfs.namenode.edits.dir</name>
    <value>file:///home/hadoop/hadoop-content/hdfs/namenode</value>
</property>

<property>
    <name>dfs.datanode.data.dir</name>
    <value>file:///home/hadoop/hadoop-content/hdfs/datanode</value>
</property>

对于core-site.xml中的temp dir,它类似于-

<configuration>
<property>
    <name>fs.defaultFS</name>
    <value>hdfs://localhost:9000</value>
</property>
<property>
    <name>hadoop.tmp.dir</name>
    <value>/home/hadoop/hadoop-content/tmp</value>
</property>

有时我们会错误地指定- file:///

bcs8qyzn

bcs8qyzn2#

/etc/hosts :
1添加此行:

your-ip-address    your-host-name

例子: 192.168.1.8 master/etc/hosts :
2删除带有 127.0.1.1 (这将导致环回)
三。在你的核心网站,改变 localhostyour-ip 或者 your-hostname 现在,重新启动集群。

相关问题