Datanode daemon not running on Hadoop 2.5.0

2019-04-10 14:48发布

I'm setting Hadoop 2.5.0 on a single machine, I'm having problem with the datanode that is not running as shown by the jps command's output:

$ jps
3404 Jps
2661 NodeManager
2606 ResourceManager
2484 NameNode

When I try to run it manually I got this:

$HADOOP_HOME/sbin/hadoop-daemon.sh start datanode
starting datanode, logging to /home/arbi/Programs/hadoop-2.5.0/logs/hadoop-arbi-datanode-ElOued.out

Then still nothing, here is the content of hadoop-arbi-datanode-ElOued.out:

ulimit -a for user arbi
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 15862
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) 15862
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

Also in http://oued.souf.dz:50070/dfshealth.html#tab-datanode there is no datanode that can be seen.

And when I submit hadoop jobs I see the following exception:

14/08/26 17:41:59 WARN mapreduce.JobSubmitter: Hadoop command-line option parsing not performed. Implement the Tool interface and execute your application with ToolRunner to remedy this.
14/08/26 17:41:59 WARN hdfs.DFSClient: DataStreamer Exception org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /tmp/hadoop-yarn/staging/arbi/.staging/job_1409065677616_0001/job.jar 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.chooseTarget(BlockManager.java:1471)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:2791)
at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.addBlock(NameNodeRpcServer.java:606)
at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.addBlock(ClientNamenodeProtocolServerSideTranslatorPB.java:455)
at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:585)
at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:928)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2013)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2009)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1614)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2007)

at org.apache.hadoop.ipc.Client.call(Client.java:1411)
at org.apache.hadoop.ipc.Client.call(Client.java:1364)
at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:206)
at com.sun.proxy.$Proxy14.addBlock(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
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.$Proxy14.addBlock(Unknown Source)
at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.addBlock(ClientNamenodeProtocolTranslatorPB.java:368)
at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.locateFollowingBlock(DFSOutputStream.java:1449)
at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.nextBlockOutputStream(DFSOutputStream.java:1270)
at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.run(DFSOutputStream.java:526)

This is a snapshot of the log file of the datanode:

2014-08-27 10:45:05,136 INFO org.apache.hadoop.hdfs.server.common.Storage: Lock on /home/arbi/Programs/hadoop-2.5.0/hdfs/datanode/in_use.lock acquired by nodename 4825@ElOued
2014-08-27 10:45:05,146 FATAL org.apache.hadoop.hdfs.server.datanode.DataNode: Initialization failed for Block pool <registering> (Datanode Uuid unassigned) service to localhost/127.0.0.1:8020. Exiting. 
java.io.IOException: Incompatible clusterIDs in /home/arbi/Programs/hadoop-2.5.0/hdfs/datanode: namenode clusterID = CID-be9e77bc-dce9-4001-b7e8-947feea5c3ad; datanode clusterID = CID-e26b44b4-deb0-4c22-ae94-abe522c4c96c
at org.apache.hadoop.hdfs.server.datanode.DataStorage.doTransition(DataStorage.java:477)
at org.apache.hadoop.hdfs.server.datanode.DataStorage.recoverTransitionRead(DataStorage.java:226)
at org.apache.hadoop.hdfs.server.datanode.DataStorage.recoverTransitionRead(DataStorage.java:254)
at org.apache.hadoop.hdfs.server.datanode.DataNode.initStorage(DataNode.java:975)
at org.apache.hadoop.hdfs.server.datanode.DataNode.initBlockPool(DataNode.java:946)
at org.apache.hadoop.hdfs.server.datanode.BPOfferService.verifyAndSetNamespaceInfo(BPOfferService.java:278)
at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.connectToNNAndHandshake(BPServiceActor.java:220)
at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.run(BPServiceActor.java:812)
at java.lang.Thread.run(Thread.java:744)
2014-08-27 10:45:05,158 WARN org.apache.hadoop.hdfs.server.datanode.DataNode: Ending block pool service for: Block pool <registering> (Datanode Uuid unassigned) service to localhost/127.0.0.1:8020
2014-08-27 10:45:05,168 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: Removed Block pool <registering> (Datanode Uuid unassigned)
2014-08-27 10:45:07,169 WARN org.apache.hadoop.hdfs.server.datanode.DataNode: Exiting Datanode
2014-08-27 10:45:07,170 INFO org.apache.hadoop.util.ExitUtil: Exiting with status 0
2014-08-27 10:45:07,170 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: SHUTDOWN_MSG: 
/************************************************************
SHUTDOWN_MSG: Shutting down DataNode at ElOued/192.168.2.206
************************************************************/

2条回答
我欲成王,谁敢阻挡
2楼-- · 2019-04-10 15:14

I solved this problem by removing hadoop directory in tmp just in terminal

sudo rm -r /tmp/hadoop-<username>

then Format the filesystem and Start NameNode and DataNode now

*****@*****:/usr/local/hadoop$ jps
19013 SecondaryNameNode
18823 DataNode
19158 Jps
18701 NameNode
查看更多
ら.Afraid
3楼-- · 2019-04-10 15:28

The problem was due to a difference between the cluster id of data node (../hadoop-2.5.0/hdfs/datanode/current/VERSION) and the cluster id in the namenode as in ../hadoop-2.5.0/hdfs/namenode/current/VERSION. I've just had to set to the same CID, but no idea what caused this difference, may be formatting HDFS many times via $HADOOP_HOME/bin/hdfs namenode -format.

查看更多
登录 后发表回答