Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hadoop MapReduce exception with multiple nodes

Tags:

hadoop

I include a self-contained sequence of commands that lead to the issue. I have a work-in-progress Cluster configuration. It is also worth noting that this same example worked fine when I didn't have all the resource and history managers configured in yarn-site.xml and mapred-site.xml.

The problem Cannot create directory /user/deploy/QuasiMonteCarlo_1391523248477_997612342/in appears to be a wrong file path prefix somewhere because the relevant user directories are:

  • /home/deploy/
  • /home/deploy/hdfs
  • /home/deploy/hdfs/name
  • /home/deploy/hdfs/data

So how come it tries accessing /user/deploy ?

deploy@olympus:~$ start-all.sh 
This script is Deprecated. Instead use start-dfs.sh and start-yarn.sh
Starting namenodes on [olympus]
olympus: starting namenode, logging to /opt/dev/hadoop/2.2.0/logs/hadoop-deploy-namenode-olympus.out
hera: starting datanode, logging to /opt/dev/hadoop/2.2.0/logs/hadoop-deploy-datanode-hera.out
olympus: starting datanode, logging to /opt/dev/hadoop/2.2.0/logs/hadoop-deploy-datanode-olympus.out
zeus: starting datanode, logging to /opt/dev/hadoop/2.2.0/logs/hadoop-deploy-datanode-zeus.out
poseidon: starting datanode, logging to /opt/dev/hadoop/2.2.0/logs/hadoop-deploy-datanode-poseidon.out
Starting secondary namenodes [0.0.0.0]
0.0.0.0: starting secondarynamenode, logging to /opt/dev/hadoop/2.2.0/logs/hadoop-deploy-secondarynamenode-olympus.out
starting yarn daemons
starting resourcemanager, logging to /opt/dev/hadoop/2.2.0/logs/yarn-deploy-resourcemanager-olympus.out
olympus: starting nodemanager, logging to /opt/dev/hadoop/2.2.0/logs/yarn-deploy-nodemanager-olympus.out
zeus: starting nodemanager, logging to /opt/dev/hadoop/2.2.0/logs/yarn-deploy-nodemanager-zeus.out
hera: starting nodemanager, logging to /opt/dev/hadoop/2.2.0/logs/yarn-deploy-nodemanager-hera.out
poseidon: starting nodemanager, logging to /opt/dev/hadoop/2.2.0/logs/yarn-deploy-nodemanager-poseidon.out
deploy@olympus:~$ hadoop jar $HADOOP_HOME/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.2.0.jar pi 2 5
Number of Maps  = 2
Samples per Map = 5
org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.hdfs.server.namenode.SafeModeException): Cannot create directory /user/deploy/QuasiMonteCarlo_1391523248477_997612342/in. Name node is in safe mode.
The reported blocks 5 has reached the threshold 0.9990 of total blocks 5. The number of live datanodes 4 has reached the minimum number 0. Safe mode will be turned off automatically in 4 seconds.
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.mkdirsInt(FSNamesystem.java:3355)
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.mkdirs(FSNamesystem.java:3330)
    at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.mkdirs(NameNodeRpcServer.java:724)
    at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.mkdirs(ClientNamenodeProtocolServerSideTranslatorPB.java:502)
    at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java:59598)
    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:2048)
    at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2044)
    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:1491)
    at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2042)

    at org.apache.hadoop.ipc.Client.call(Client.java:1347)
    at org.apache.hadoop.ipc.Client.call(Client.java:1300)
    at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:206)
    at com.sun.proxy.$Proxy9.mkdirs(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:186)
    at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:102)
    at com.sun.proxy.$Proxy9.mkdirs(Unknown Source)
    at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.mkdirs(ClientNamenodeProtocolTranslatorPB.java:467)
    at org.apache.hadoop.hdfs.DFSClient.primitiveMkdir(DFSClient.java:2394)
    at org.apache.hadoop.hdfs.DFSClient.mkdirs(DFSClient.java:2365)
    at org.apache.hadoop.hdfs.DistributedFileSystem$16.doCall(DistributedFileSystem.java:817)
    at org.apache.hadoop.hdfs.DistributedFileSystem$16.doCall(DistributedFileSystem.java:813)
    at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
    at org.apache.hadoop.hdfs.DistributedFileSystem.mkdirsInternal(DistributedFileSystem.java:813)
    at org.apache.hadoop.hdfs.DistributedFileSystem.mkdirs(DistributedFileSystem.java:806)
    at org.apache.hadoop.fs.FileSystem.mkdirs(FileSystem.java:1933)
    at org.apache.hadoop.examples.QuasiMonteCarlo.estimatePi(QuasiMonteCarlo.java:282)
    at org.apache.hadoop.examples.QuasiMonteCarlo.run(QuasiMonteCarlo.java:354)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
    at org.apache.hadoop.examples.QuasiMonteCarlo.main(QuasiMonteCarlo.java:363)
    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.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:72)
    at org.apache.hadoop.util.ProgramDriver.run(ProgramDriver.java:144)
    at org.apache.hadoop.examples.ExampleDriver.main(ExampleDriver.java:74)
    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.util.RunJar.main(RunJar.java:212)
like image 755
SkyWalker Avatar asked Dec 01 '22 02:12

SkyWalker


2 Answers

you can try below command.

$HADOOP_HOME/bin/hadoop dfsadmin -safemode leave
like image 102
anyoneking Avatar answered Dec 28 '22 13:12

anyoneking


Job is being kicked off before namenode is out of safemode after startup. Starting job after namenode leaves safemode will fix the issue.

like image 22
rVr Avatar answered Dec 28 '22 14:12

rVr