Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
MapReduce >> mail # user >> Re: Running map reduce job from a web application


Copy link to this message
-
Re: Running map reduce job from a web application
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_+[EMAIL PROTECTED]%3E

Regards

Bertrand

On Fri, Aug 24, 2012 at 6:01 AM, Chandra Mohan, Ananda Vel Murugan <
[EMAIL PROTECTED]> 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
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB