属性中没有有效的本地目录:mapred.local.dir

时间:2015-07-15 09:58:35

标签: hadoop cloudera

我在伪模式下运行VM。 由于一些与资源相关的问题(名称节点处于安全模式,无法离开),我不得不格式化并重新启动Cloudera 4.x的namenode。我没有别的选择。 我使用了这里提供的步骤:

Writing to HDFS could only be replicated to 0 nodes instead of minReplication (=1)

之后我能够在hdfs中正确使用get / put命令,这意味着我有读/写权限。 现在,当我尝试提交作业时,我遇到了异常。

Exception in thread "main"org.apache.hadoop.ipc.RemoteException(java.io.IOException): java.io.IOException: No valid local directories in property: mapred.local.dir
    at org.apache.hadoop.mapred.JobTracker.submitJob(JobTracker.java:3491)
    at org.apache.hadoop.mapred.JobTracker.submitJob(JobTracker.java:3459)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.hadoop.ipc.WritableRpcEngine$Server$WritableRpcInvoker.call(WritableRpcEngine.java:474)
    at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:898)
    at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1693)
    at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1689)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:396)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1332)
    at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1687)
Caused by: java.io.IOException: No valid local directories in property: mapred.local.dir
    at org.apache.hadoop.conf.Configuration.getLocalPath(Configuration.java:1678)
    at org.apache.hadoop.mapred.JobConf.getLocalPath(JobConf.java:500)
    at org.apache.hadoop.mapred.JobInProgress.<init>(JobInProgress.java:409)
    at org.apache.hadoop.mapred.JobTracker.submitJob(JobTracker.java:3489)
    ... 13 more
    at org.apache.hadoop.ipc.Client.call(Client.java:1160)
    at org.apache.hadoop.ipc.WritableRpcEngine$Invoker.invoke(WritableRpcEngine.java:225)
    at org.apache.hadoop.mapred.$Proxy10.submitJob(Unknown Source)
    at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:973)
    at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:896)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:396)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1332)
    at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:896)
    at org.apache.hadoop.mapreduce.Job.submit(Job.java:531)
    at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:561)
    at clustering.mapreduce.KMeansClusteringJob.main(KMeansClusteringJob.java:69)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:208)**

当我搜索上述异常时,我发现多个链接表明应该正确定义mapred.local.dir,如果没有设置,则使用hadoop.tmp.dir。 我在mapred-site.xml中显式设置了mapred.local.dir,并获得了对默认文件夹(/ var / lib / hadoop-hdfs / cache)的完全权限。 问题仍然存在。

有人可以帮忙解决问题吗? 此致

1 个答案:

答案 0 :(得分:1)

没有给予本地目录适当的权限 - 在评论中提供了标记为社区维基的答案