问题

  1. [root@hadoop109 ~]# hdfs dfs -ls /
  2. Found 1 items
  3. -rw-r--r-- 2 root supergroup 1361 2020-01-15 21:35 /README.txt
  4. [root@hadoop109 ~]# hdfs dfs -cat /README.txt
  5. 2020-02-03 09:26:09,898 WARN impl.BlockReaderFactory: I/O error constructing remote block reader.
  6. java.net.NoRouteToHostException: 没有到主机的路由
  7. at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
  8. at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
  9. ......
  10. at org.apache.hadoop.fs.FsShell.main(FsShell.java:390)
  11. 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.

解决

经过调查发现,在配置集群时,忘记将其他节点的防火墙关闭,导致无法正常访问,关闭防火墙即可