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 <j...@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 <joso...@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

Reply via email to