问题
[root@hadoop109 ~]# hdfs dfs -ls /
Found 1 items
-rw-r--r-- 2 root supergroup 1361 2020-01-15 21:35 /README.txt
[root@hadoop109 ~]# hdfs dfs -cat /README.txt
2020-02-03 09:26:09,898 WARN impl.BlockReaderFactory: I/O error constructing remote block reader.
java.net.NoRouteToHostException: 没有到主机的路由
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
......
at org.apache.hadoop.fs.FsShell.main(FsShell.java:390)
2020-02-03 09:26:09,931 WARN hdfs.DFSClient: Failed to connect to /10.150.8.103:9866 for file /README.txt for block BP-245694188-10.150.8.101-1578765268354:blk_1073741826_1002, add to deadNodes and continue.
解决
经过调查发现,在配置集群时,忘记将其他节点的防火墙关闭,导致无法正常访问,关闭防火墙即可