Created 03-23-2017 03:56 PM
Hi there,
How to find the name of supergroup in hadoop and list all the members of the group?
I know hdfs is the super user in hadoop, but SuperGroup name
Created 03-23-2017 04:18 PM
@Jeeva Jeeva - There is a property "dfs.permissions.superusergroup" in hdfs-site.xml which specifies the superusergroup.
Please see below apache guide for HDFS Permissions:
https://hadoop.apache.org/docs/r2.4.1/hadoop-project-dist/hadoop-hdfs/HdfsPermissionsGuide.html
To list all the users belonging to the supergroup, its just like getting users belonging to a group in linux. Below is good article on that:
https://www.cyberciti.biz/faq/linux-list-all-members-of-a-group/
Created 03-23-2017 04:10 PM
Is dfs.permissions.superusergroup in hdfs-site.xml what you are looking for?
Created 03-23-2017 05:41 PM
yes. But, how to list all the users in the superusergroup?
I found superusergroup : hdfs in hdfs-site.xml. But, how to find the users in the group hdfs.
Created 03-23-2017 04:18 PM
@Jeeva Jeeva - There is a property "dfs.permissions.superusergroup" in hdfs-site.xml which specifies the superusergroup.
Please see below apache guide for HDFS Permissions:
https://hadoop.apache.org/docs/r2.4.1/hadoop-project-dist/hadoop-hdfs/HdfsPermissionsGuide.html
To list all the users belonging to the supergroup, its just like getting users belonging to a group in linux. Below is good article on that:
https://www.cyberciti.biz/faq/linux-list-all-members-of-a-group/
Created 03-23-2017 05:01 PM
Hi Namit Maheshwari,
Thanks for your time to reply. Your answer saved my life and one more question
How to see the members of the superusergroup for a namenode?
In my case, the super user is "hdfs".
I have been asked to find all the members of the superuser group.
/etc/group file is not for the namenode. So, there should be some other way.
Created 03-23-2017 05:15 PM
Hi Jeeva,
Find the superusergroup value in hdfs-site.xml. Lets say for instance this value is 'hadoop'
Once you find that value, you need to do is "grep 'superusergroup:' /etc/group"
i.e if that value is hadoop, it will be:
grep 'hadoop:' /etc/group
This should return you the list of all users belonging to the supergroup.
Created 03-23-2017 05:23 PM
Hi Maheshwari,
Our superusergroup is hdfs
That's what i did. He asked me where i got these members from and i told from /etc/group file. But, Technical Lead said something different. Here is the conversation we had below.
Jeeva:I got it from /etc/group file
Fred: that is correct for this particular server
how about what namenode?
that's where 'hdfs groups' tell you
Created 03-23-2017 05:27 PM
I think what he means is to check the same on the namenode hosts.
Created 03-23-2017 05:37 PM
Could you suggest me how to check on the namenode?
Created 03-23-2017 05:58 PM
You just need to logon to the namenode hosts and run the same grep command on the /etc/group file
Created 03-23-2017 06:01 PM
Also to find the namenode hosts, just look at the property value for dfs.namenode.rpc-address in hdfs-site.xml
Created 03-23-2017 06:14 PM
Is there any way to find it from ambari without logging to NameNode?
If it is not, how to log on to the namenode from linux(edge node)? sorry for the trivial questiion.
I tried to login from putty, i got exception.
Created 03-23-2017 06:25 PM
I dont think we can get this from Ambari as this is a Linux file, and Ambari is not involved in maintaining that.
As far as logging on to the Namenode, it should be the similar as how you logged on to any other host on the cluster.
We use ssh with a keypair to logon, but thats your environment specific. So, if you have the IP, you should be able to logon to the Namenode host.
Created 03-23-2017 06:43 PM
Anyway.. Thanks for your involvement on this issue. Once i resolved it, I will let you know. I used putty to login but got exception.
Created 03-23-2017 06:53 PM
Ok sure. Yeah I cant say how to logon to your Namenode linux machine. Someone, in your team over there might help.
Also, can you please accept the answer for how to find the supergroup in Hdfs. As, I think you found that information. Thanks!
Created 03-23-2017 07:31 PM
Hi Mahesh,
There is no way to list all members of supergroup. But, we can run for individual user to see if they are belong to the group by using the below command.
hdfs groups <username>
Once again, thanks for time .