美文网首页
虚拟机搭建hadoop集群报java.net.ConnectEx

虚拟机搭建hadoop集群报java.net.ConnectEx

作者: 捞月亮的阿汤哥 | 来源:发表于2019-06-10 01:37 被阅读0次

    问题描述

    我的core-site.xml的文件如下

    <configuration>
      <property>
        <name>fs.defaultFS</name>
        <value>hdfs://node1:9000</value>
      </property>
      <property>
        <name>hadoop.tmp.dir</name>
        <value>/tmp/hadoop-2.8.5</value>
      </property>
    </configuration>
    

    node1是我hdfs的主节点,然后在node1这台机器上,执行start-dfs.sh,在node2和node3可以看到DataNode的jps,但是使用hdfs dfs -ls /命令就会报

    ls: Call From node2/x.x.x.x to node1:9000 failed on connection exception: java.net.ConnectException: 拒绝连接; For more details see:  http://wiki.apache.org/hadoop/ConnectionRefused
    

    问题解决

    将node1的core-site.xml文件修改如下

    <configuration>
    <property>
    <name>fs.defaultFS</name>
    <value>hdfs://0.0.0.0:9000</value>
    </property>
    <property>
    <name>hadoop.tmp.dir</name>
    <value>/tmp/hadoop-2.8.5</value>
    </property>
    </configuration>
    

    然后执行

    stop-dfs.sh
    hadoop namenode -format
    start-dfs.sh
    

    ok,问题解决

    相关文章

      网友评论

          本文标题:虚拟机搭建hadoop集群报java.net.ConnectEx

          本文链接:https://www.haomeiwen.com/subject/scaoxctx.html