How to add user in supergroup of hdfs in linux?

0 votes
I was working on hdfs then i found something that permissions checks are not performed for the super-user. If my linux user is jino and i want add jino 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 ?
Sep 20, 2018 in Big Data Hadoop by Neha
• 6,300 points
4,527 views

1 answer to this question.

0 votes

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 jino
  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 jino:testgroup

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}
                      OR

You can also add the user to hadoop group.

$ sudo adduser --ingroup hadoop jino

I hope this helps :)

answered Sep 20, 2018 by Frankie
• 9,810 points

Related Questions In Big Data Hadoop

0 votes
1 answer

How to print the content of a file in console present in HDFS?

Yes, you can use hdfs dfs command ...READ MORE

answered Apr 19, 2018 in Big Data Hadoop by Shubham
• 13,450 points
2,243 views
0 votes
1 answer

How to check the size of a file in Hadoop HDFS?

You can use the  hadoop fs -ls command to ...READ MORE

answered Nov 21, 2018 in Big Data Hadoop by Omkar
• 69,030 points
3,307 views
0 votes
1 answer

How to set rep to particular user in hdfs?

HDFS does not allocate capacity separately based ...READ MORE

answered Jul 5, 2019 in Big Data Hadoop by Leena
92 views
0 votes
1 answer

How to view contents of file in hadoop hdfs?

Hi@akhtar, You can use the Hadoop filesystem command ...READ MORE

answered Oct 5 in Big Data Hadoop by MD
• 79,930 points
103 views
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,950 points
6,352 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,950 points
985 views
+1 vote
11 answers

hadoop fs -put command?

put syntax: put <localSrc> <dest> copy syntax: copyF ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Aditya
41,902 views
–1 vote
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,320 points
2,377 views
0 votes
1 answer

How to write a file in HDFS using Java Programming language?

Define the HADOOP_CONF_DIR environment variable to your Hadoop configuration ...READ MORE

answered Sep 28, 2018 in Big Data Hadoop by Frankie
• 9,810 points
1,087 views
0 votes
1 answer

How to get absolute path of files in a directory in Hadoop?

You can use HDFS API like the ...READ MORE

answered Dec 4, 2018 in Big Data Hadoop by Frankie
• 9,810 points
2,079 views