Java自学者论坛

 找回密码
 立即注册

手机号码,快捷登录

恭喜Java自学者论坛(https://www.javazxz.com)已经为数万Java学习者服务超过8年了!积累会员资料超过10000G+
成为本站VIP会员,下载本站10000G+会员资源,会员资料板块,购买链接:点击进入购买VIP会员

JAVA高级面试进阶训练营视频教程

Java架构师系统进阶VIP课程

分布式高可用全栈开发微服务教程Go语言视频零基础入门到精通Java架构师3期(课件+源码)
Java开发全终端实战租房项目视频教程SpringBoot2.X入门到高级使用教程大数据培训第六期全套视频教程深度学习(CNN RNN GAN)算法原理Java亿级流量电商系统视频教程
互联网架构师视频教程年薪50万Spark2.0从入门到精通年薪50万!人工智能学习路线教程年薪50万大数据入门到精通学习路线年薪50万机器学习入门到精通教程
仿小米商城类app和小程序视频教程深度学习数据分析基础到实战最新黑马javaEE2.1就业课程从 0到JVM实战高手教程MySQL入门到精通教程
查看: 24707|回复: 0

【原创】hadoop启动错误 找不到路由 解决方法

[复制链接]
  • TA的每日心情
    奋斗
    4 天前
  • 签到天数: 803 天

    [LV.10]以坛为家III

    2053

    主题

    2111

    帖子

    72万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    726482
    发表于 2021-4-7 15:52:19 | 显示全部楼层 |阅读模式

    hadoop启动过程中遇到下面的问题:


    2012-07-04 18:43:20,763 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: STARTUP_MSG: /************************************************************ STARTUP_MSG: Starting DataNode STARTUP_MSG: host = slave1/192.168.18.87 STARTUP_MSG: args = [] STARTUP_MSG: version = 0.20.2 STARTUP_MSG: build = https://svn.apache.org/repos/asf ... ranches/branch-0.20 -r 911707; compiled by 'chrisdo' on Fri Feb 19 08:07:34 UTC 2010 ************************************************************/ 2012-07-04 18:43:22,468 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: /192.168.18.218:9000. Already tried 0 time(s). 2012-07-04 18:43:23,468 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: /192.168.18.218:9000. Already tried 1 time(s). 2012-07-04 18:43:24,469 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: /192.168.18.218:9000. Already tried 2 time(s). 2012-07-04 18:43:25,470 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: /192.168.18.218:9000. Already tried 3 time(s). 2012-07-04 18:43:26,471 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: /192.168.18.218:9000. Already tried 4 time(s). 2012-07-04 18:43:27,472 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: /192.168.18.218:9000. Already tried 5 time(s). 2012-07-04 18:43:28,473 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: /192.168.18.218:9000. Already tried 6 time(s). 2012-07-04 18:43:29,474 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: /192.168.18.218:9000. Already tried 7 time(s). 2012-07-04 18:43:30,475 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: /192.168.18.218:9000. Already tried 8 time(s). 2012-07-04 18:43:31,475 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: /192.168.18.218:9000. Already tried 9 time(s). 2012-07-04 18:43:31,479 ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: java.io.IOException: Call to /192.168.18.218:9000 failed on local exception: java.net.NoRouteToHostException: 没有到主机的路由 at org.apache.hadoop.ipc.Client.wrapException(Client.java:775) at org.apache.hadoop.ipc.Client.call(Client.java:743) at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:220) at $Proxy4.getProtocolVersion(Unknown Source) at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:359) at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:346) at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:383) at org.apache.hadoop.ipc.RPC.waitForProxy(RPC.java:314) at org.apache.hadoop.ipc.RPC.waitForProxy(RPC.java:291) at org.apache.hadoop.hdfs.server.datanode.DataNode.startDataNode(DataNode.java:269) at org.apache.hadoop.hdfs.server.datanode.DataNode.<init>(DataNode.java:216) at org.apache.hadoop.hdfs.server.datanode.DataNode.makeInstance(DataNode.java:1283) at org.apache.hadoop.hdfs.server.datanode.DataNode.instantiateDataNode(DataNode.java:1238) at org.apache.hadoop.hdfs.server.datanode.DataNode.createDataNode(DataNode.java:1246) at org.apache.hadoop.hdfs.server.datanode.DataNode.main(DataNode.java:1368) Caused by: java.net.NoRouteToHostException: 没有到主机的路由 at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:701)

    NameNode启动start-all.sh时出现上述错误,解决办法如下:

    (1)从namenode主机ping其它主机名(如:ping slave1),如果ping不通,原因可能是namenode节点的/etc/hosts配置错误

    (2)从datanode主机ping namenode主机名,如果ping不通,原因可能是datenode节点的/etc/hosts配置的配置错误

    解决办法:以上两种错误都需要修改/etc/hosts,同时保证集群中所有机器的/etc/hosts一致,参考:http://hi.baidu.com/tdfrank/blog/item/a1b9e1d95e3b013f10df9b01.html

    (3)查看namenode主机的9000(具体根据core-site.xml中的fs.default.name节点配置)端口,是否打开,如果已打开(如下图所示),原因可能是防火墙开启,解决办法:关闭namenode和datanode主机的防火墙,或者设置防火墙开启指定端口

    [root@master swxing]# netstat -nap | grep 9000
    tcp        0      0 ::ffff:192.168.18.218:9000  :::*                        LISTEN      4662/java           
    tcp        0      0 ::ffff:192.168.18.218:46116 ::ffff:192.168.18.218:9000  ESTABLISHED 4859/java           
    tcp        0      0 ::ffff:192.168.18.218:9000  ::ffff:192.168.18.87:36794  ESTABLISHED 4662/java           
    tcp        0      0 ::ffff:192.168.18.218:9000  ::ffff:192.168.18.218:46116 ESTABLISHED 4662/java      

     

    [root@master swxing]# service iptables stop

    可以参考:http://www.cnblogs.com/siwei1988/archive/2012/07/12/2587527.html  设置开机不启动防火墙服务,这样就不用每次开机后都设置了。

    (4)格式化硬盘(hadoop namenode -format)后启动namenode(start-all.sh)

     

    以上操作命令是在centos6.1中的操作命令,其它linux系统的操作命令可能有些不一样,读者根据自己的系统来定义操作,本文只提供一个思路。
    哎...今天够累的,签到来了1...
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|手机版|小黑屋|Java自学者论坛 ( 声明:本站文章及资料整理自互联网,用于Java自学者交流学习使用,对资料版权不负任何法律责任,若有侵权请及时联系客服屏蔽删除 )

    GMT+8, 2024-11-21 22:42 , Processed in 0.067010 second(s), 30 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2021, Tencent Cloud.

    快速回复 返回顶部 返回列表