hdfs权限被拒绝

64jmpszr  于 2021-06-02  发布在  Hadoop
关注(0)|答案(0)|浏览(285)

我正在尝试从java开始mapreduce工作。但当我试图提交我得到的工作 Permission Denied 例外。我能跑了 hdfs dfs -ls / 从命令行没有任何错误。但是我的java程序不能运行。
这是我的密码

public static void main(String[] args) {
    Configuration conf=new Configuration();

    conf.set("mapreduce.map.class","org.apache.hadoop.conf.TestMapper");
    conf.set("mapreduce.reduce.class","org.apache.hadoop.conf.TestReducer");

    conf.set("mapreduce.framework.name","yarn");

    conf.set("hadoop.security.group.mapping","org.apache.hadoop.security.ShellBasedUnixGroupsMapping");

    conf.set("fs.default.name","hdfs://master:9000");

    conf.set("dfs.permission","false");

    conf.set("yarn.nodemanager.aux-services","mapreduce_shuffle");
    conf.set("yarn.resourcemanager.resource-tracker.address","master:8025");
    conf.set("yarn.resourcemanager.scheduler.address","master:8030");
    conf.set("yarn.resourcemanager.address","master:8040");
    conf.set("yarn.nodemanager.localizer.address","master:8060");
    Job job=null;
    try {
        job = Job.getInstance(conf, "Test Map Reduce");

        job.setJarByClass(RunJob.class);

        job.setOutputKeyClass(LongWritable.class);
        job.setOutputValueClass(Text.class);

        job.setInputFormatClass(TextInputFormat.class);
        job.setOutputFormatClass(TextOutputFormat.class);

        TextInputFormat.setInputPaths(job, new Path("/input.txt"));
        TextOutputFormat.setOutputPath(job, new Path("/output"));

        job.submit();

}

但我有以下例外

org.apache.hadoop.security.AccessControlException: Permission denied: user=manthosh, access=EXECUTE, inode="/tmp":hduser:supergroup:drwxrwx---

这里的解决方案行不通。
我错过了什么?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题