0

I used the cloudera-quickstart-vm to build up a hadoop cluster and integerted it with kerberos (no AD or LDAP, ShellBasedUnixGroupsMapping).Then I tried to create some users, but found they were all in superuser group. So how can I create a user in non-superuser group?

operation

tk421
  • 5,775
  • 6
  • 23
  • 34
  • Questions on professional server- or networking-related infrastructure administration are off-topic for Stack Overflow unless they directly involve programming or programming tools. You may be able to get help on ServerFault.com. – T-Heron Jun 22 '18 at 11:02

1 Answers1

0

Hadoop is a virtual file-system which means you can not directly create a user like you do in Linux. So, in HDFS you have to create a user directory as an HDFS user.

hdfs dfs -mkdir /user/<user_name>

Now, it will be added to HDFS group by default which is a super-user group. So, you need to edit the owner permissions. For that, you can simply run chown command :

hdfs dfs -chown -R [user]:[group] /user/<user_name>

That's all.

Abhinav
  • 658
  • 1
  • 9
  • 27
  • I created a HDFS directory /tmp/etl owned by hdfs:etl (permission 770). Then I made the HDFS direcotry /user/user1 owned by user1:etl, and I also used the host command usermod to make user1 in etl group. But the user1 still had no permission to create any directory in /tmp/etl, why? – rugalcrimson Jun 23 '18 at 10:01
  • @rugalcrimson Sorry for the late reply. Now, let me tell you where did you go wrong, but first I tell you how I followed what u said: 1. Created a unix user "user1" 2. Create etl group in unix and added user1 to etl group 3. created /tmp/etl directory and set permissions and owners as u said 4. created /user/user1 as u said and changed the group Now, the real problem begins: 5. logged in as a user1 user, tried hdfs dfs -mkdir /tmp/etl/abc but generated an error. WHY? Bcz hdfs is a superuser, you cannot perform any action in hdfs until and unless u r hdfs user just like it is with root – Abhinav Jun 28 '18 at 14:01