用hdfs上传文件出现错误,这是因为有机器没有关闭防火墙导致的
hdfs dfs -put people.csv /
18/03/15 00:34:50 INFO hdfs.DataStreamer: Exception in createBlockOutputStream
java.net.NoRouteToHostException: No route to host
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:712)
at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206)
at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:531)
at org.apache.hadoop.hdfs.DataStreamer.createSocketForPipeline(DataStreamer.java:226)
at org.apache.hadoop.hdfs.DataStreamer.createBlockOutputStream(DataStreamer.java:1591)
at org.apache.hadoop.hdfs.DataStreamer.nextBlockOutputStream(DataStreamer.java:1547)
at org.apache.hadoop.hdfs.DataStreamer.run(DataStreamer.java:658)
18/03/15 00:34:50 WARN hdfs.DataStreamer: Abandoning BP-2130725462-192.168.199.99-1503413608084:blk_1073741853_1029
18/03/15 00:34:50 WARN hdfs.DataStreamer: Excluding datanode DatanodeInfoWithStorage[192.168.199.101:50010,DS-49c869eb-ba19-4b26-aade-fb1f68ef4a03,DISK]
18/03/15 00:34:50 INFO hdfs.DataStreamer: Exception in createBlockOutputStream
关闭firewall:
- systemctl stop firewalld.service #停止firewall
- systemctl disable firewalld.service #禁止firewall开机启动
- firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running