[prev in list] [next in list] [prev in thread] [next in thread]
List: hadoop-user
Subject: Re: Get member list of group in HDFS using Java/Script
From: Shashi Vishwakarma <shashi.vish123 () gmail ! com>
Date: 2016-02-20 17:53:14
Message-ID: CA+aZ0XMKfFv2ASo=-Sui92GPDp9L_JSe7utNX4EX6HmSAmcoMw () mail ! gmail ! com
[Download RAW message or body]
Thanks Chris. Information you provided is very much helpful..
On 20 Feb 2016 12:18 am, "Chris Nauroth" <cnauroth@hortonworks.com> wrote:
> Hello Shashi,
>
> HDFS itself doesn't have any knowledge of membership of users in groups.
> The user and group field of an HDFS file or directory are just arbitrary
> strings. For consulting a user's group memberships, HDFS runs a group
> mapping provider [1]. This is pluggable, but the common case is either
> querying the underlying OS directly or querying an LDAP server.
>
> For a given username, you can check what HDFS thinks its group memberships
> are by running the "hdfs groups" command [2]. For example:
>
> > hdfs groups chris
> chris : staff everyone localaccounts _appserverusr admin _appserveradm
> _lpadmin _appstore _lpoperator _developer com.apple.access_screensharing
> com.apple.access_ssh
>
> However, there is no way to query a list of all users in a group through
> HDFS. HDFS doesn't have a use case for this kind of query, so it doesn't
> implement one. For that, I'd expect you'd need to query directly whatever
> your group membership infrastructure is (i.e. run the "groups" command at
> the OS layer or query an LDAP server).
>
> I hope this helps.
>
> --Chris Nauroth
>
> [1]
> http://hadoop.apache.org/docs/r2.7.2/hadoop-project-dist/hadoop-hdfs/HdfsPermissionsGuide.html#Group_Mapping
> [2]
> http://hadoop.apache.org/docs/r2.7.2/hadoop-project-dist/hadoop-hdfs/HDFSCommands.html#groups
>
>
> From: Shashi Vishwakarma <shashi.vish123@gmail.com>
> Date: Thursday, February 18, 2016 at 11:29 PM
> To: "user@hadoop.apache.org" <user@hadoop.apache.org>
> Subject: Get member list of group in HDFS using Java/Script
>
> Hi
>
> I need to find how many users belong to particular group in HDFS using
> Java/Script.
>
> Let's say I have a directory /user/data in HDFS and it belongs to a group
> 'abc' .
>
> I need to find how may other users belongs to 'abc' group.
>
> Can anyone suggest something.
>
> Thanks
>
[Attachment #3 (text/html)]
<p dir="ltr">Thanks Chris. Information you provided is very much helpful..</p>
<div class="gmail_quote">On 20 Feb 2016 12:18 am, "Chris Nauroth" <<a \
href="mailto:cnauroth@hortonworks.com">cnauroth@hortonworks.com</a>> wrote:<br \
type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>
<div>Hello Shashi,</div>
<div><br>
</div>
<div>HDFS itself doesn't have any knowledge of membership of users in groups. \
The user and group field of an HDFS file or directory are just arbitrary strings. \
For consulting a user's group memberships, HDFS runs a group mapping provider \
[1]. This is pluggable, but the common case is either querying the underlying OS \
directly or querying an LDAP server.</div> <div><br>
</div>
<div>For a given username, you can check what HDFS thinks its group memberships are \
by running the "hdfs groups" command [2]. For example:</div> <div><br>
</div>
<div>
<div>> hdfs groups chris</div>
<div>chris : staff everyone localaccounts _appserverusr admin _appserveradm _lpadmin \
_appstore _lpoperator _developer com.apple.access_screensharing \
com.apple.access_ssh</div> </div>
<div><br>
</div>
<div>However, there is no way to query a list of all users in a group through HDFS. \
HDFS doesn't have a use case for this kind of query, so it doesn't implement \
one. For that, I'd expect you'd need to query directly whatever your group \
membership infrastructure is (i.e. run the "groups" command at the OS \
layer or query an LDAP server).</div> <div><br>
</div>
<div>I hope this helps.</div>
<div><br>
</div>
<div><font color="#000000"><font face="Calibri">--Chris Nauroth</font></font></div>
</div>
<div><font color="#000000"><font face="Calibri"><br>
</font></font></div>
<div><font color="#000000"><font face="Calibri">[1] </font></font><a \
href="http://hadoop.apache.org/docs/r2.7.2/hadoop-project-dist/hadoop-hdfs/HdfsPermissionsGuide.html#Group_Mapping" \
target="_blank">http://hadoop.apache.org/docs/r2.7.2/hadoop-project-dist/hadoop-hdfs/HdfsPermissionsGuide.html#Group_Mapping</a></div>
<div>[2] <a href="http://hadoop.apache.org/docs/r2.7.2/hadoop-project-dist/hadoop-hdfs/HDFSCommands.html#groups" \
target="_blank">http://hadoop.apache.org/docs/r2.7.2/hadoop-project-dist/hadoop-hdfs/HDFSCommands.html#groups</a></div>
<div><br>
</div>
<div><br>
</div>
<span>
<div style="font-family:Calibri;font-size:11pt;text-align:left;color:black;BORDER-BOTTOM:medium \
none;BORDER-LEFT:medium \
none;PADDING-BOTTOM:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;BORDER-TOP:#b5c4df 1pt \
solid;BORDER-RIGHT:medium none;PADDING-TOP:3pt"> <span style="font-weight:bold">From: \
</span>Shashi Vishwakarma <<a href="mailto:shashi.vish123@gmail.com" \
target="_blank">shashi.vish123@gmail.com</a>><br> <span \
style="font-weight:bold">Date: </span>Thursday, February 18, 2016 at 11:29 PM<br> \
<span style="font-weight:bold">To: </span>"<a \
href="mailto:user@hadoop.apache.org" target="_blank">user@hadoop.apache.org</a>" \
<<a href="mailto:user@hadoop.apache.org" \
target="_blank">user@hadoop.apache.org</a>><br> <span \
style="font-weight:bold">Subject: </span>Get member list of group in HDFS using \
Java/Script<br> </div>
<div><br>
</div>
<div>
<div>
<div dir="ltr">Hi
<div>
<div><br>
</div>
<div>I need to find how many users belong to particular group in HDFS using \
Java/Script.</div> <div><br>
</div>
<div>Let's say I have a directory /user/data in HDFS and it belongs to a group \
'abc' .</div> <div><br>
</div>
<div>I need to find how may other users belongs to 'abc' group.</div>
<div><br>
</div>
<div>Can anyone suggest something.</div>
</div>
<div><br>
</div>
<div>Thanks</div>
</div>
</div>
</div>
</span>
</div>
</blockquote></div>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic