hadoop:有0个datanode正在运行,并且在此操作中没有排除任何节点

atmip9wb  于 2021-05-29  发布在  Hadoop
关注(0)|答案(5)|浏览(489)

我在vmware上部署了hadoop集群。他们都在centos 7上。
在主机上发出命令jps:

  1. [root@hadoopmaster anna]# jps
  2. 6225 NameNode
  3. 6995 ResourceManager
  4. 6580 SecondaryNameNode
  5. 7254 Jps

在从机上发出命令jps:

  1. [root@hadoopslave1 anna]# jps
  2. 5066 DataNode
  3. 5818 Jps
  4. 5503 NodeManager

但是,我不知道为什么现场节点http://localhost:50070/dfshealth.html#选项卡概述显示0。我不能发布hdfs dfs-put-in/file/f1。显示错误信息:

  1. [root@hadoopmaster hadoop]# hdfs dfs -put in/file/f1 /user
  2. 16/01/06 02:53:14 WARN hdfs.DFSClient: DataStreamer Exception
  3. org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /user._COPYING_ could only be replicated to 0 nodes instead of minReplication (=1). There are 0 datanode(s) running and no node(s) are excluded in this operation.
  4. at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.chooseTarget4NewBlock(BlockManager.java:1550)
  5. at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getNewBlockTargets(FSNamesystem.java:3110)
  6. at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:3034)
  7. at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.addBlock(NameNodeRpcServer.java:723)
  8. at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.addBlock(ClientNamenodeProtocolServerSideTranslatorPB.java:492)
  9. at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
  10. at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:616)
  11. at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:969)
  12. at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2049)
  13. at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2045)
  14. at java.security.AccessController.doPrivileged(Native Method)
  15. at javax.security.auth.Subject.doAs(Subject.java:422)
  16. at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
  17. at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2043)
  18. at org.apache.hadoop.ipc.Client.call(Client.java:1476)
  19. at org.apache.hadoop.ipc.Client.call(Client.java:1407)
  20. at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:229)
  21. at com.sun.proxy.$Proxy9.addBlock(Unknown Source)
  22. at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.addBlock(ClientNamenodeProtocolTranslatorPB.java:418)
  23. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  24. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  25. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  26. at java.lang.reflect.Method.invoke(Method.java:497)
  27. at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:187)
  28. at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:102)
  29. at com.sun.proxy.$Proxy10.addBlock(Unknown Source)
  30. at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.locateFollowingBlock(DFSOutputStream.java:1430)
  31. at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.nextBlockOutputStream(DFSOutputStream.java:1226)
  32. at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.run(DFSOutputStream.java:449)
  33. put: File /user._COPYING_ could only be replicated to 0 nodes instead of minReplication (=1). There are 0 datanode(s) running and no node(s) are excluded in this operation.

我试过其他类似的帖子

  1. rm -R /tmp/*

并检查ssh
在主机上:

  1. [root@hadoopmaster hadoop]# ssh hadoopmaster
  2. Last login: Wed Jan 6 02:56:27 2016 from hadoopslave1
  3. [root@hadoopmaster ~]# exit
  4. logout
  5. Connection to hadoopmaster closed.
  6. [root@hadoopmaster hadoop]# ssh hadoopslave1
  7. Last login: Wed Jan 6 02:43:21 2016
  8. [root@hadoopslave1 ~]# exit
  9. logout
  10. Connection to hadoopslave1 closed.
  11. [root@hadoopmaster hadoop]#

从机上:

  1. [root@hadoopslave1 .ssh]# ssh hadoopmaster
  2. Last login: Wed Jan 6 03:04:45 2016 from hadoopmaster
  3. [root@hadoopmaster ~]# exit
  4. logout
  5. Connection to hadoopmaster closed.
  6. [root@hadoopslave1 .ssh]# ssh hadoopslave1
  7. Last login: Wed Jan 6 03:04:40 2016 from hadoopmaster
  8. [root@hadoopslave1 ~]# exit
  9. logout
  10. Connection to hadoopslave1 closed.
  11. [root@hadoopslave1 .ssh]#
lxkprmvk

lxkprmvk1#

我通过在/etc/hosts中配置机器解决了类似的问题。查看datanode日志表明datanodes无法解析namenode。

uurv41yg

uurv41yg2#

我也有同样的问题。copyfromlocal:文件。复制只能复制到0个节点,而不是minreplication(=1)。有1个datanode正在运行,此操作中没有排除任何节点。我通过释放一些空间来解决这个问题。您还可以尝试停止数据节点并重新启动它。

jw5wzhpr

jw5wzhpr3#

从name节点运行以下命令,以确保数据节点正常运行

  1. bin/hadoop dfsadmin -report

你可以看到这样的报道

  1. -------------------------------------------------
  2. Datanodes available: 1 (1 total, 0 dead)
  3. Name: 127.0.0.1:50010
  4. Decommission Status : Normal
  5. Configured Capacity: 176945963008 (164.79 GB)
  6. DFS Used: 2140192768 (1.99 GB)
  7. Non DFS Used: 42513027072 (39.59 GB)
  8. DFS Remaining: 132292743168(123.21 GB)
  9. DFS Used%: 1.21%
  10. DFS Remaining%: 74.76%
  11. Last contact: Wed Jan 06 20:04:51 IST 2016
展开查看全部
esbemjvw

esbemjvw4#

这很可能是由于可用磁盘空间。检查硬盘使用情况 df -h 关于这个问题,这里有一些类似的问题和答案

cgyqldqp

cgyqldqp5#

您需要查看datanode日志,以确认slave上的数据节点是否运行正常。仅仅运行jps命令是不够好的,有时datanode可能会失去连接。如果配置文件正确,请运行以下命令:
运行stop-all.sh
在所有节点上运行jps,如果有任何进程仍在运行-杀死它们
运行start-all.sh
在所有节点上运行jps命令
检查namenode日志和datanode日志,确认一切正常。

相关问题