mapred.local.dir error in hadoop streaming

2019-08-29 07:42发布

Error:

hadoop_admin@ubuntu:~/hadoop$ bin/hadoop jar /home/hadoop_admin/hadoop/contrib/streaming/hadoop-0.20.0-streaming.jar -input data -output DOUT -mapper /home/balachanderp/libsvm-hadoop-master/scripts/mapperLibsvm.py -reducer /home/balachanderp/libsvm-hadoop-master/scripts/reducerLibsvm.py -file /home/balachanderp/libsvm-hadoop-master/scripts/mapperLibsvm.py  -file /home/balachanderp/libsvm-hadoop-master/scripts/reducerLibsvm.py 
packageJobJar: [/home/balachanderp/libsvm-hadoop-master/scripts/mapperLibsvm.py, /home/balachanderp/libsvm-hadoop-master/scripts/reducerLibsvm.py, /home/hadoop_admin/hadoop/hadoop-tmp/hadoop-unjar7855728852423515318/] [] /tmp/streamjob5538341312778875750.jar tmpDir=null
13/04/03 19:48:15 INFO mapred.FileInputFormat: Total input paths to process : 1
13/04/03 19:48:16 ERROR streaming.StreamJob: Error Launching job : java.io.IOException:     No valid local directories in property: mapred.local.dir
at org.apache.hadoop.conf.Configuration.getLocalPath(Configuration.java:890)
at org.apache.hadoop.mapred.JobConf.getLocalPath(JobConf.java:345)
at org.apache.hadoop.mapred.JobInProgress.<init>(JobInProgress.java:242)
at org.apache.hadoop.mapred.JobInProgress.<init>(JobInProgress.java:226)
at org.apache.hadoop.mapred.JobTracker.submitJob(JobTracker.java:2918)
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:616)
at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:508)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:959)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:955)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:416)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:953)

Streaming Job Failed!

Im trying to run a map-reduce python scripts via command line. My command line input is

bin/hadoop jar /home/hadoop_admin/hadoop/contrib/streaming/hadoop-0.20.0-streaming.jar     -input data -output DOUT -mapper /home/balachanderp/libsvm-hadoop-master/scripts/mapperLibsvm.py

I even tied..

bin/hadoop jar /home/hadoop_admin/hadoop/contrib/streaming/hadoop-0.20.0-streaming.jar     -input data -output DOUT -mapper /home/balachanderp/libsvm-hadoop-master/scripts/mapperLibsvm.py -reducer /home/balachanderp/libsvm-hadoop-master/scripts/reducerLibsvm.py -file /home/balachanderp/libsvm-hadoop-master/scripts/mapperLibsvm.py  -file /home/balachanderp/libsvm-hadoop-master/scripts/reducerLibsvm.py

Can someone help me out as to how to solve this problem.

1条回答
Animai°情兽
2楼-- · 2019-08-29 08:34

13/04/03 19:48:16 ERROR streaming.StreamJob: Error Launching job : java.io.IOException: No valid local directories in property: mapred.local.dir

Make sure TaskTracker, JobTracker, DataNode and NameNode are all running correctly. You can use jps and the output should look like following

$ jps
6755 TaskTracker
7297 Jps
6149 DataNode
6393 SecondaryNameNode
5907 NameNode
6488 JobTracker

mapred.local.dir can be left empty. The default location is < hadoop.tmp.dir >/mapred.

hadoop.tmp.dir is defined in core-site.xml like following

<property>
  <name>hadoop.tmp.dir</name>
  <value>/home/hduser/data/tmp</value>
  <description>A base for other temporary directories.</description>
</property>
查看更多
登录 后发表回答