hadoop-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bertrand Dechoux <decho...@gmail.com>
Subject Re: Running map reduce job from a web application
Date Fri, 24 Aug 2012 05:57:45 GMT
I haven't been confronted to your use case but your error message
explicitly says that you are not passing correctly the user "hadoop".
You should use the doAs() method on UserGroupInformation in order to
execute the job with this particular user.

http://mail-archives.apache.org/mod_mbox/hadoop-general/201009.mbox/%3CAANLkTiknJ_SzRux7KhjhxVfUU9FBkNgvYnkpbz3G_+a4@mail.gmail.com%3E

Regards

Bertrand

On Fri, Aug 24, 2012 at 6:01 AM, Chandra Mohan, Ananda Vel Murugan <
Ananda.Murugan@honeywell.com> wrote:

>  Hi, ****
>
> ** **
>
> I am developing a web application in Java which would be hosted in a
> machine outside of my Hadoop cluster. User account configuration would be
> different between the machines. ****
>
> ** **
>
> I am using the following code in my servlet to run the map-reduce job.****
>
> ** **
>
> ** **
>
> *final* Configuration config = *new* Configuration();****
>
>             config.set("mapred.job.tracker", "<jobtracker.hostname>:9001"
> );****
>
>             config.set("fs.default.name", "hdfs://<namenode>:9000");****
>
>             config.set("hadoop.tmp.dir",
> "/var/lib/hadoop/data-store/hadoop-hadoop");****
>
>             config.set("hadoop.job.ugi", "hadoop,hadoop");****
>
>             UserGroupInformation *ugi1* = UserGroupInformation.*
> createRemoteUser*("hadoop");****
>
>             Job job = *new* Job(config);****
>
>             job.setJarByClass(ImportTsv.*class*);****
>
>             job.setJobName("ImportTsv");****
>
>             job.getConfiguration().set("user", "hadoop");****
>
>             job.waitForCompletion(*true*);****
>
>             job.submit();****
>
>             *Iterator* iter = config.iterator();****
>
>             *while*(iter.hasNext())****
>
>             {****
>
>                   Object obj = iter.next();****
>
>                   System.*out*.println(obj);****
>
>             }****
>
> ** **
>
> It is not working and failing with following authentication error****
>
> ** **
>
> Exception in thread "main" *
> org.apache.hadoop.security.AccessControlException*: *
> org.apache.hadoop.security.AccessControlException*: Permission denied:
> user=E317376, access=WRITE, inode="staging":hadoop:supergroup:rwxr-xr-x***
> *
>
> ** **
>
> Appreciate your inputs for fixing this.****
>
> ** **
>
> Regards,****
>
> Anand.C ****
>
> ** **
>
> ** **
>



-- 
Bertrand Dechoux

Mime
View raw message