You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-user@hadoop.apache.org by Jose Luis Soler <jo...@gmail.com> on 2012/02/16 18:51:30 UTC

Mapreduce Job' user

Hi All,

Is there some way to force the owner (user name) of a Job sent to a 
Hadoop cluster?

I'm trying to use the following code when configuring the job:

JobConf job = new JobConf();

job.setUser("desiredUserName");

but it seems to have no effect as the job owner is sent as the user I'm 
logged into the system.

Even I tried  this:

System.set("user.name", "desiredUserName")

and this, at the command line when running the job:

-Duser.name=desiredUserName

getting no different result.

Thanks for your help.

Jose


Re: Mapreduce Job' user

Posted by Harsh J <ha...@cloudera.com>.
Joey has it right if you are indeed using a security-enabled release,
and the configuration for the same is documented at
http://hadoop.apache.org/common/docs/r1.0.0/Secure_Impersonation.html

On Fri, Feb 17, 2012 at 1:13 AM, Joey Echeverria <jo...@cloudera.com> wrote:
> Are you using one of the security enabled releases of Hadoop
> (0.20.20x,1.0.x,0.23.x,CDH3)? Assuming you are, you need to do something
> like the following to impersonate a user:
>
> You'll need to modify your code to use something like this:
>
> UserGroupInformation.createRemoteUser("cuser").doAs(new
> PrivilegedExceptionAction()... {
>  void run() {
>    // submit my evil job
>  }
> };
>
> -Joey
>
> On Thu, Feb 16, 2012 at 12:51 PM, Jose Luis Soler <jo...@gmail.com> wrote:
>>
>> Hi All,
>>
>> Is there some way to force the owner (user name) of a Job sent to a Hadoop
>> cluster?
>>
>> I'm trying to use the following code when configuring the job:
>>
>> JobConf job = new JobConf();
>>
>> job.setUser("desiredUserName");
>>
>> but it seems to have no effect as the job owner is sent as the user I'm
>> logged into the system.
>>
>> Even I tried  this:
>>
>> System.set("user.name", "desiredUserName")
>>
>> and this, at the command line when running the job:
>>
>> -Duser.name=desiredUserName
>>
>> getting no different result.
>>
>> Thanks for your help.
>>
>> Jose
>>
>
>
>
> --
> Joseph Echeverria
> Cloudera, Inc.
> 443.305.9434
>



-- 
Harsh J
Customer Ops. Engineer
Cloudera | http://tiny.cloudera.com/about

Re: Mapreduce Job' user

Posted by Joey Echeverria <jo...@cloudera.com>.
Are you using one of the security enabled releases of Hadoop
(0.20.20x,1.0.x,0.23.x,CDH3)? Assuming you are, you need to do something
like the following to impersonate a user:

You'll need to modify your code to use something like this:

UserGroupInformation.createRemoteUser("cuser").doAs(new
PrivilegedExceptionAction()... {
 void run() {
   // submit my evil job
 }
};

-Joey

On Thu, Feb 16, 2012 at 12:51 PM, Jose Luis Soler <jo...@gmail.com> wrote:

> Hi All,
>
> Is there some way to force the owner (user name) of a Job sent to a Hadoop
> cluster?
>
> I'm trying to use the following code when configuring the job:
>
> JobConf job = new JobConf();
>
> job.setUser("desiredUserName")**;
>
> but it seems to have no effect as the job owner is sent as the user I'm
> logged into the system.
>
> Even I tried  this:
>
> System.set("user.name", "desiredUserName")
>
> and this, at the command line when running the job:
>
> -Duser.name=desiredUserName
>
> getting no different result.
>
> Thanks for your help.
>
> Jose
>
>


-- 
Joseph Echeverria
Cloudera, Inc.
443.305.9434

Re: Mapreduce Job' user

Posted by Vamshi Krishna <va...@gmail.com>.
Hi Jose,
According to my knowledge, if you want to use any options with -D , at the
commandline when running jobs, you cannot use any options other than the
ones listed in the link
http://hadoop.apache.org/common/docs/current/mapred-default.html  .
Therefore you cannot use  "user.name" . The first argument of the line you
have mentioned  i.e System.set("user.name", "desiredUserName") , should be
one of those properties mentioned in the above link and accordingly you can
set that value appropriately.

On Thu, Feb 16, 2012 at 11:21 PM, Jose Luis Soler <jo...@gmail.com> wrote:

> Hi All,
>
> Is there some way to force the owner (user name) of a Job sent to a Hadoop
> cluster?
>
> I'm trying to use the following code when configuring the job:
>
> JobConf job = new JobConf();
>
> job.setUser("desiredUserName")**;
>
> but it seems to have no effect as the job owner is sent as the user I'm
> logged into the system.
>
> Even I tried  this:
>
> System.set("user.name", "desiredUserName")
>
> and this, at the command line when running the job:
>
> -Duser.name=desiredUserName
>
> getting no different result.
>
> Thanks for your help.
>
> Jose
>
>


-- 
*Regards*
*
Vamshi Krishna
*