2014-12-04 96 views
0

我有一個名爲WordCountMain.jar的jar。我想在多模式集羣中使用hadoop命令運行此jar。Mapreduce隊列設置

但我的用戶ID被標記爲排隊名稱爲「歐米茄」。所以如果我使用下面的命令運行上面的jar,那麼我得到一個錯誤,表明我的id沒有submit_job訪問權限。在多模集羣

hadoop jar WordCountMain.jar /user/cloudera/inputs/words.txt /user/cloudera/output 

所以上面的命令沒有工作,但它在單節點集羣CDH3工作

我如何包括隊列名,而在運行上面的jar?

Configuration conf = new Configuration(); 

Job job = new Job(conf,"word count"); 
job.getConfiguration().set("mapreduce.job.queuename","omega"); 

job.setJarByClass(WordCountCombinerMain.class); 

Path inputFilePath = new Path(args[0]); 
Path outputFilePath = new Path(args[1]); 

FileInputFormat.addInputPath(job, inputFilePath); 
FileOutputFormat.setOutputPath(job, outputFilePath); 

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

job.setMapperClass(CWordCountMapper.class); 
job.setCombinerClass(CWordCountCombiner1.class); 
job.setReducerClass(CWordCountCombiner1.class); 
//job.setReducerClass(CwordCountReducer.class); 

job.setMapOutputKeyClass(Text.class); 
job.setMapOutputValueClass(IntWritable.class); 

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

job.waitForCompletion(true); 
job.submit(); 

但是我得到了下面的錯誤。這個錯誤說,我的MapReduce工作就是讓在默認隊列提交..有人可以幫助我在此

ERROR ipc.RPC: FailoverProxy: Failing this Call: submitJob for error(RemoteException):  org.apache.hadoop.ipc.RemoteException: org.apache.hadoop.security.AccessControlException: User mytra cannot perform operation SUBMIT_JOB on queue default 

回答

0

在你的驅動程序類嘗試可能的解決方案

  • 解決方法1:configuration.set("mapred.job.queue.name", "omega");

  • 解決方案2:

    String queueName= "omega"; 
    job.getConfiguration().set("mapreduce.job.queuename", queueName);