背景:
阅读新闻
Hadoop HDFS分布式文件系统
[日期:2012-12-22] 来源:Linux社区 作者:Linux [字体:]
1.把linux操作系统的input目录拷贝到Hadoop文件系统中重命名为in目录
[grid@h1 hadoop-0.20.2]$ bin/hadoop dfs -put ../input in 把linux操作系统的input目录拷贝到hadoop文件系统中重命名为in目录12/09/16 20:18:20 INFO hdfs.DFSClient: Exception in createBlockOutputStream java.io.IOException: Bad connect ack with firstBadLink 192.168.2.103:50010 没有关闭防火墙
12/09/16 20:18:20 INFO hdfs.DFSClient: Abandoning block blk_-2034091982680781464_102612/09/16 20:18:26 INFO hdfs.DFSClient: Exception in createBlockOutputStream java.io.IOException: Bad connect ack withfirstBadLink192.168.2.103:5001012/09/16 20:18:26 INFO hdfs.DFSClient: Abandoning block blk_-3493343259834508347_102612/09/16 20:18:32 INFO hdfs.DFSClient: Exception in createBlockOutputStream java.io.IOException: Bad connect ack with firstBadLink 192.168.2.103:50010
12/09/16 20:18:32 INFO hdfs.DFSClient: Abandoning block blk_4302532573839164645_1026
12/09/16 20:18:38 INFO hdfs.DFSClient: Exception in createBlockOutputStream java.net.NoRouteToHostException: No route to host12/09/16 20:18:38 INFO hdfs.DFSClient: Abandoning block blk_4602162403828631999_1026
12/09/16 20:18:44 WARN hdfs.DFSClient: DataStreamer Exception: java.io.IOException: Unable to create new block.at org.apache.hadoop.hdfs.DFSClient$DFSOutputStream.nextBlockOutputStream(DFSClient.java:2845) at org.apache.hadoop.hdfs.DFSClient$DFSOutputStream.access$2000(DFSClient.java:2102) at org.apache.hadoop.hdfs.DFSClient$DFSOutputStream$DataStreamer.run(DFSClient.java:2288)12/09/16 20:18:44 WARN hdfs.DFSClient: Error Recovery for block blk_4602162403828631999_1026 bad datanode[0] nodes == null12/09/16 20:18:44 WARN hdfs.DFSClient: Could not get block locations. Source file "/user/grid/in/input/test2.txt" - Aborting...
put: No route to host12/09/16 20:18:44 ERROR hdfs.DFSClient: Exception closing file /user/grid/in/input/test2.txt : java.net.NoRouteToHostException: No route to hostjava.net.NoRouteToHostException: No route to host at sun.nio.ch.SocketChannelImpl.checkConnect(Natve Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:567) 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.DFSClient$DFSOutputStream.createBlockOutputStream(DFSClient.java:2870) at org.apache.hadoop.hdfs.DFSClient$DFSOutputStream.nextBlockOutputStream(DFSClient.java:2826) atorg.apache.hadoop.hdfs.DFSClient$DFSOutputStream.access$2000(DFSClient.java:2102) at org.apache.hadoop.hdfs.DFSClient$DFSOutputStream$DataStreamer.run(DFSClient.java:2288)
小结:这是没有关闭Linux防火墙造成的,使用 service iptables stop/start 临时关闭/开启 chkconfig iptables off/on 永久关闭/开启防火墙命令来控制防火墙,关闭之后就可以顺利的进行下面操作了。
[grid@h1 grid]$ hadoop dfs -put abc.txt abc 把linux操作系统东西拷贝到hadoop文件系统中并重命名abc
[grid@h1 grid]$ hadoop dfs -ls abc文件已经在hadoop文件系统根目录下了
Found 3 items
-rw-r--r-- 2 grid supergroup 44 2012-09-18 19:12 /user/grid/abc 随机存放到某一个节点
drwxr-xr-x - grid supergroup 0 2012-09-17 19:44 /user/grid/in
drwxr-xr-x - grid supergroup 0 2012-09-17 20:41 /user/grid/out
相关资讯
本文评论 查看全部评论 (0)
尊重网上道德,遵守中华人民共和国的各项有关法律法规 承担一切因您的行为而直接或间接导致的民事或刑事法律责任 本站管理人员有权保留或删除其管辖留言中的任意内容 本站有权在网站内转载或引用您的评论 参与本评论即表明您已经阅读并接受上述条款
评论声明
最新资讯