gpt4 book ai didi

hadoop 空指针异常

转载 作者:可可西里 更新时间:2023-11-01 14:47:51 25 4
gpt4 key购买 nike

我正在尝试设置 hadoop 的多节点集群 michael-noll's way使用两台计算机。

当我尝试格式化 hdfs 时,它显示了一个 NullPointerException

hadoop@psycho-O:~/project/hadoop-0.20.2$ bin/start-dfs.sh
starting namenode, logging to /home/hadoop/project/hadoop-0.20.2/bin/../logs/hadoop-hadoop-namenode-psycho-O.out
slave: bash: line 0: cd: /home/hadoop/project/hadoop-0.20.2/bin/..: No such file or directory
slave: bash: /home/hadoop/project/hadoop-0.20.2/bin/hadoop-daemon.sh: No such file or directory
master: starting datanode, logging to /home/hadoop/project/hadoop-0.20.2/bin/../logs/hadoop-hadoop-datanode-psycho-O.out
master: starting secondarynamenode, logging to /home/hadoop/project/hadoop-0.20.2/bin/../logs/hadoop-hadoop-secondarynamenode-psycho-O.out
master: Exception in thread "main" java.lang.NullPointerException
master: at org.apache.hadoop.net.NetUtils.createSocketAddr(NetUtils.java:134)
master: at org.apache.hadoop.hdfs.server.namenode.NameNode.getAddress(NameNode.java:156)
master: at org.apache.hadoop.hdfs.server.namenode.NameNode.getAddress(NameNode.java:160)
master: at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.initialize(SecondaryNameNode.java:131)
master: at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.<init>(SecondaryNameNode.java:115)
master: at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.main(SecondaryNameNode.java:469)
hadoop@psycho-O:~/project/hadoop-0.20.2$

我不知道是什么原因造成的。请帮我找出问题所在。我不是这个话题的新手,所以请尽可能减少您的回答。 :)

如果需要更多信息,请告诉我。

最佳答案

master:     at org.apache.hadoop.net.NetUtils.createSocketAddr(NetUtils.java:134)
master: at org.apache.hadoop.hdfs.server.namenode.NameNode.getAddress(NameNode.java:156)
master: at org.apache.hadoop.hdfs.server.namenode.NameNode.getAddress(NameNode.java:160)

似乎您的辅助名称节点无法连接到主要名称节点,这绝对是整个系统顺利运行所必需的,因为需要完成检查点工作。所以我猜你的网络配置有问题,包括:

  • ${HADOOP_HOME}/conf/core-site.xml,其中包含如下内容:

    <!-- Put site-specific property overrides in this file. -->
    <configuration>
    <property>
    <name>hadoop.tmp.dir</name>
    <value>/app/hadoop/tmp</value>
    <description>A base for other temporary directories.</description>
    </property>

    <property>
    <name>fs.default.name</name>
    <value>hdfs://master:54310</value>
    <description>The name of the default file system. A URI whose
    scheme and authority determine the FileSystem implementation. The
    uri's scheme determines the config property (fs.SCHEME.impl) naming
    the FileSystem implementation class. The uri's authority is used to
    determine the host, port, etc. for a filesystem.</description>
    </property>
    </configuration>
  • 和/etc/hosts。这个文件真的是一个滑坡,你得小心这些ip别名,它应该与拥有该ip的机器的主机名一致。

        127.0.0.1   localhost
    127.0.1.1 zac

    # 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

    192.168.1.153 master #pay attention to these two!!!
    192.168.99.146 slave1

关于hadoop 空指针异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5490805/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com