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

时间:2016-01-06 11:13:22

标签: hadoop hdfs

我在VMware上部署了Hadoop集群。他们全都在CentOS 7上。

在Master上发出命令jps:

[root@hadoopmaster anna]# jps
6225 NameNode
6995 ResourceManager
6580 SecondaryNameNode
7254 Jps

在Slave上发出命令jps:

[root@hadoopslave1 anna]# jps
5066 DataNode
5818 Jps
5503 NodeManager

但是,我不知道为什么http://localhost:50070/dfshealth.html#tab-overview上的实时节点 显示0.我无法在/ file / f1中发出hdfs dfs -put。它显示错误消息:

[root@hadoopmaster hadoop]# hdfs dfs -put in/file/f1 /user
16/01/06 02:53:14 WARN hdfs.DFSClient: DataStreamer Exception
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.
    at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.chooseTarget4NewBlock(BlockManager.java:1550)
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getNewBlockTargets(FSNamesystem.java:3110)
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:3034)
    at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.addBlock(NameNodeRpcServer.java:723)
    at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.addBlock(ClientNamenodeProtocolServerSideTranslatorPB.java:492)
    at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
    at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:616)
    at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:969)
    at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2049)
    at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2045)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:422)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
    at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2043)

    at org.apache.hadoop.ipc.Client.call(Client.java:1476)
    at org.apache.hadoop.ipc.Client.call(Client.java:1407)
    at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:229)
    at com.sun.proxy.$Proxy9.addBlock(Unknown Source)
    at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.addBlock(ClientNamenodeProtocolTranslatorPB.java:418)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:187)
    at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:102)
    at com.sun.proxy.$Proxy10.addBlock(Unknown Source)
    at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.locateFollowingBlock(DFSOutputStream.java:1430)
    at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.nextBlockOutputStream(DFSOutputStream.java:1226)
    at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.run(DFSOutputStream.java:449)
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.

我尝过其他帖子,比如

rm -R /tmp/*

并检查ssh

关于主人:

[root@hadoopmaster hadoop]# ssh hadoopmaster
Last login: Wed Jan  6 02:56:27 2016 from hadoopslave1
[root@hadoopmaster ~]# exit
logout
Connection to hadoopmaster closed.
[root@hadoopmaster hadoop]# ssh hadoopslave1
Last login: Wed Jan  6 02:43:21 2016
[root@hadoopslave1 ~]# exit
logout
Connection to hadoopslave1 closed.
[root@hadoopmaster hadoop]#
奴隶上的

[root@hadoopslave1 .ssh]# ssh hadoopmaster
Last login: Wed Jan  6 03:04:45 2016 from hadoopmaster
[root@hadoopmaster ~]# exit
logout
Connection to hadoopmaster closed.
[root@hadoopslave1 .ssh]# ssh hadoopslave1
Last login: Wed Jan  6 03:04:40 2016 from hadoopmaster
[root@hadoopslave1 ~]# exit
logout
Connection to hadoopslave1 closed.
[root@hadoopslave1 .ssh]# 

5 个答案:

答案 0 :(得分:1)

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

bin/hadoop dfsadmin -report

你可以看到像

这样的报告
-------------------------------------------------
Datanodes available: 1 (1 total, 0 dead)

Name: 127.0.0.1:50010
Decommission Status : Normal
Configured Capacity: 176945963008 (164.79 GB)
DFS Used: 2140192768 (1.99 GB)
Non DFS Used: 42513027072 (39.59 GB)
DFS Remaining: 132292743168(123.21 GB)
DFS Used%: 1.21%
DFS Remaining%: 74.76%
Last contact: Wed Jan 06 20:04:51 IST 2016

答案 1 :(得分:0)

您需要查看datanode日志以确认slave上的数据节点是否实际运行正常。仅运行jps命令还不够好,有时datanode可能会断开连接。如果配置文件正确,请运行:

  • 运行stop-all.sh
  • 在所有节点上运行jps,如果有任何进程仍在运行 - 将其杀死
  • 运行start-all.sh
  • 在所有节点上运行jps命令
  • 检查namenode日志和datanode日志以确认每件事情都没问题。

答案 2 :(得分:-1)

我通过配置/ etc / hosts中的计算机解决了类似的问题。查看datanode日志表明Datanodes无法解析Namenode。

答案 3 :(得分:-1)

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

答案 4 :(得分:-1)

这很可能是由于可用磁盘空间。使用df -h

检查您的硬盘使用情况

关于此问题,有一些类似的问题和答案,例如here