Hadoop 2.9.0 datanode没有运行

时间:2018-02-18 03:29:03

标签: hadoop hdfs hadoop2

我正在关注this教程设置Hadoop-2.9.0当我执行以下命令时:

sbin/start-df.sh

我在终端上得到以下输出:

Starting namenodes on [localhost]
localhost: starting namenode, logging to /home/uname/hadoop-2.9.0/logs/hadoop-uname-namenode-mname.out
localhost: starting datanode, logging to /home/uname/hadoop-2.9.0/logs/hadoop-uname-datanode-mname.out
Starting secondary namenodes [0.0.0.0]
0.0.0.0: starting secondarynamenode, logging to /home/uname/hadoop-2.9.0/logs/hadoop-uname-secondarynamenode-mname.out

然后当我尝试使用以下命令

按照教程here复制内容时

bin/hdfs dfs -put etc/hadoop input

我收到以下错误:

put: File /user/uname/input/yarn-site.xml._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.

以下代码块是上述错误的详细堆栈跟踪。你可以在第一次阅读时忽略它。

    18/02/17 21:59:45 WARN hdfs.DataStreamer: DataStreamer Exception
org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /user/uname/input/yarn-site.xml._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:1797)
    at org.apache.hadoop.hdfs.server.namenode.FSDirWriteFileOp.chooseTargetForNewBlock(FSDirWriteFileOp.java:265)
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:2559)
    at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.addBlock(NameNodeRpcServer.java:846)
    at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.addBlock(ClientNamenodeProtocolServerSideTranslatorPB.java:510)
    at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
    at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:503)
    at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:989)
    at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:868)
    at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:814)
    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:1886)
    at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2603)

    at org.apache.hadoop.ipc.Client.getRpcResponse(Client.java:1493)
    at org.apache.hadoop.ipc.Client.call(Client.java:1439)
    at org.apache.hadoop.ipc.Client.call(Client.java:1349)
    at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:227)
    at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:116)
    at com.sun.proxy.$Proxy10.addBlock(Unknown Source)
    at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.addBlock(ClientNamenodeProtocolTranslatorPB.java:444)
    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:498)
    at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:422)
    at org.apache.hadoop.io.retry.RetryInvocationHandler$Call.invokeMethod(RetryInvocationHandler.java:165)
    at org.apache.hadoop.io.retry.RetryInvocationHandler$Call.invoke(RetryInvocationHandler.java:157)
    at org.apache.hadoop.io.retry.RetryInvocationHandler$Call.invokeOnce(RetryInvocationHandler.java:95)
    at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:359)
    at com.sun.proxy.$Proxy11.addBlock(Unknown Source)
    at org.apache.hadoop.hdfs.DataStreamer.locateFollowingBlock(DataStreamer.java:1845)
    at org.apache.hadoop.hdfs.DataStreamer.nextBlockOutputStream(DataStreamer.java:1645)
    at org.apache.hadoop.hdfs.DataStreamer.run(DataStreamer.java:710)
put: File /user/uname/input/yarn-site.xml._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.

我不确定为什么没有运行datanode?我在thisthis回答了一些问题,但它没有用。如果你查看问题的第二个代码块,它会说启动datanode。和日志写入/home/uname/hadoop-2.9.0/logs/hadoop-uname-datanode-mname.out。我没有在日志中发现任何错误。我正在复制下面的日志。

ulimit -a for user uname
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 63757
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 63757
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

验证数据节点是否确实在运行。我再次执行了第一个启动命令。

sbin/start-df.sh

我收到了以下信息:

Starting namenodes on [localhost]
localhost: namenode running as process 24802. Stop it first.
localhost: starting datanode, logging to /home/uname/hadoop-2.9.0/logs/hadoop-uname-datanode-mname.out
Starting secondary namenodes [0.0.0.0]
0.0.0.0: secondarynamenode running as process 25166. Stop it first.

此消息表明namenode和secondarynamenode已在运行。但是,这也没有显示datanode正在运行,它会再次尝试启动datanode并在日志文件中写入相同的日志。

知道为什么namenode没有启动?

1 个答案:

答案 0 :(得分:1)

实际上,您需要从logs目录调试日志文件。 可能需要删除Namenode和Datanode Log目录。 再次创建日志目录。 之后运行hadoop namenode format命令。 然后运行start-dfs.sh并start-yarn.sh。