how to add user in supergroup of hdfs in linux?

45,265

Solution 1

Yes , now i have whole idea how users and group should be created on any hdfs cluster. First of all i didn't find any group named supergroup in /etc/group.

So good practice is to create your own supergroup.

  1. sudo addgroup testgroup
  2. Then create users as many you want. e.g adduser sandy
  3. Then add these users to testgroup
  4. Then edit hdfs-site.xml property and add this property dfs.permissions.superusergroup, value will be your group name
  5. Now you can create any number of folders in hdfs and then assign ownership as yourusername:supergroup e.g sandy:testgroup

Solution 2

Its not a good pratice to run jobs as super-user. Be advised to create a new group and new account for hadoop/hdfs and then give required permissions as below

$ sudo addgroup hadoop
$ sudo adduser --ingroup hadoop hduser

$ sudo chown hduser:hadoop {directory path}
Share:
45,265

Related videos on Youtube

sandip divekar
Author by

sandip divekar

I am Devops Engineer working in Persistent systems pune,India. I am currently working on Hadoop , Cloudera , PIG and Tools related to hadoop. I am also working on Automation tools (Chef , Puppet, Jenkins) and others tools related to Devops.

Updated on November 06, 2020

Comments

  • sandip divekar
    sandip divekar over 3 years

    I was working on hdfs then i found something that permissions checks are not performed for the super-user. If my linux user is sandy and i want add sandy to group of super-user. So permissions denied will not occur, is it feasible to do that in hdfs configuration. And if there is no problem in assigning the user to supergroup then how to do it ?

  • sandip divekar
    sandip divekar almost 10 years
    is it feasible to add that user in supergroup or is it considering the user access policies of hadoop ?
  • Ramanan
    Ramanan almost 10 years
    To add user to super user group $ sudo adduser <username> sudo
  • Martin Serrano
    Martin Serrano almost 7 years
    FYI, use groupadd on centos/rhel