hadoop搭建,上传文件时出现错误,没有到主机的路由

来源:互联网 发布:北京网络 编辑:程序博客网 时间:2024/06/04 18:27

[hadoop@Master file]hadoopfsmkdirinput3[hadoop@Masterfile] hadoop fs -put ./file*.txt input3
15/03/18 22:54:00 INFO hdfs.DFSClient: Exception in createBlockOutputStream java.net.NoRouteToHostException: 没有到主机的路由
15/03/18 22:54:00 INFO hdfs.DFSClient: Abandoning block blk_-2701910714669546890_10073
15/03/18 22:54:06 INFO hdfs.DFSClient: Exception in createBlockOutputStream java.net.NoRouteToHostException: 没有到主机的路由
15/03/18 22:54:06 INFO hdfs.DFSClient: Abandoning block blk_-6595394394333564261_10073
15/03/18 22:54:12 INFO hdfs.DFSClient: Exception in createBlockOutputStream java.net.NoRouteToHostException: 没有到主机的路由
15/03/18 22:54:12 INFO hdfs.DFSClient: Abandoning block blk_-7654232478902170768_10073
15/03/18 22:54:18 INFO hdfs.DFSClient: Exception in createBlockOutputStream java.net.NoRouteToHostException: 没有到主机的路由
15/03/18 22:54:18 INFO hdfs.DFSClient: Abandoning block blk_-4057949388287825875_10074
15/03/18 22:54:24 WARN hdfs.DFSClient: DataStreamer Exception: java.io.IOException: Unable to create new block.
at org.apache.hadoop.hdfs.DFSClientDFSOutputStream.nextBlockOutputStream(DFSClient.java:2845)atorg.apache.hadoop.hdfs.DFSClientDFSOutputStream.access2000(DFSClient.java:2102)atorg.apache.hadoop.hdfs.DFSClientDFSOutputStream$DataStreamer.run(DFSClient.java:2288)

15/03/18 22:54:24 WARN hdfs.DFSClient: Error Recovery for block blk_-4057949388287825875_10074 bad datanode[0] nodes == null
15/03/18 22:54:24 WARN hdfs.DFSClient: Could not get block locations. Source file “/user/hadoop/input3/file1.txt” - Aborting…
15/03/18 22:54:24 INFO hdfs.DFSClient: Exception in createBlockOutputStream java.net.NoRouteToHostException: 没有到主机的路由
15/03/18 22:54:24 INFO hdfs.DFSClient: Abandoning block blk_-7080188390242653981_10075
15/03/18 22:54:30 INFO hdfs.DFSClient: Exception in createBlockOutputStream java.net.NoRouteToHostException: 没有到主机的路由
15/03/18 22:54:30 INFO hdfs.DFSClient: Abandoning block blk_-6858744431122541922_10075
15/03/18 22:54:36 INFO hdfs.DFSClient: Exception in createBlockOutputStream java.net.NoRouteToHostException: 没有到主机的路由
15/03/18 22:54:36 INFO hdfs.DFSClient: Abandoning block blk_-5335567731842422100_10075
15/03/18 22:54:42 INFO hdfs.DFSClient: Exception in createBlockOutputStream java.net.NoRouteToHostException: 没有到主机的路由
15/03/18 22:54:42 INFO hdfs.DFSClient: Abandoning block blk_7680139810007024027_10075
15/03/18 22:54:48 WARN hdfs.DFSClient: DataStreamer Exception: java.io.IOException: Unable to create new block.
at org.apache.hadoop.hdfs.DFSClientDFSOutputStream.nextBlockOutputStream(DFSClient.java:2845)atorg.apache.hadoop.hdfs.DFSClientDFSOutputStream.access2000(DFSClient.java:2102)atorg.apache.hadoop.hdfs.DFSClientDFSOutputStream$DataStreamer.run(DFSClient.java:2288)

15/03/18 22:54:48 WARN hdfs.DFSClient: Error Recovery for block blk_7680139810007024027_10075 bad datanode[0] nodes == null
15/03/18 22:54:48 WARN hdfs.DFSClient: Could not get block locations. Source file “/user/hadoop/input3/file2.txt” - Aborting…
put: 没有到主机的路由
没有到主机的路由

15/03/18 22:54:48 ERROR hdfs.DFSClient: Exception closing file /user/hadoop/input3/file1.txt : java.net.NoRouteToHostException: 没有到主机的路由
java.net.NoRouteToHostException: 没有到主机的路由
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)
at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206)
at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:404)
at org.apache.hadoop.hdfs.DFSClientDFSOutputStream.createBlockOutputStream(DFSClient.java:2870)atorg.apache.hadoop.hdfs.DFSClientDFSOutputStream.nextBlockOutputStream(DFSClient.java:2826)
at org.apache.hadoop.hdfs.DFSClientDFSOutputStream.access2000(DFSClient.java:2102)
at org.apache.hadoop.hdfs.DFSClientDFSOutputStreamDataStreamer.run(DFSClient.java:2288)
15/03/18 22:54:48 ERROR hdfs.DFSClient: Exception closing file /user/hadoop/input3/file2.txt : java.net.NoRouteToHostException: 没有到主机的路由
java.net.NoRouteToHostException: 没有到主机的路由
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)
at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206)
at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:404)
at org.apache.hadoop.hdfs.DFSClientDFSOutputStream.createBlockOutputStream(DFSClient.java:2870)atorg.apache.hadoop.hdfs.DFSClientDFSOutputStream.nextBlockOutputStream(DFSClient.java:2826)
at org.apache.hadoop.hdfs.DFSClientDFSOutputStream.access2000(DFSClient.java:2102)
at org.apache.hadoop.hdfs.DFSClientDFSOutputStreamDataStreamer.run(DFSClient.java:2288)

解决方案:
(1)从namenode主机ping其它slaves节点的主机名(注意是slaves节点的主机名),如果ping不通,原因可能是namenode节点的/etc/hosts 未配置主机名与IP地址的映射关系,补全主机名与IP地址的映射关系。

(2)从datanode主机ping master节点的主机名(注意也是节点的主机名),如果ping不通,原因可能是datenode节点的/etc/hosts 未配置主机名与IP地址的映射关系,补全主机名与IP地址的映射关系。

(3)查看各机器节点的防火墙是否关闭(或者设置防火墙开启,但对我们的指定端口开放,最好是关闭防火墙):

阅读全文
0 0
原创粉丝点击