- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How to create user in hadoop?
- Labels:
-
Apache Hadoop
-
Apache Hive
Created ‎02-21-2019 12:12 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to create user in hadoop?
Created ‎02-21-2019 12:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steps
- Connect to a host in the cluster that includes the HDFS client.
- Switch to the hdfs system account user. su - hdfs.
- Using the HDFS client, make an HDFS directory for the user. For example, if your username is admin, you would create the following directory. ...
- Set the ownership on the newly created directory
Created ‎02-21-2019 12:31 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Example: Suppose you want to create a new user "newuser1" on HDFS.
So first create a user on your Host (client machine) and add it to "hadoop" group
# useradd newuser1 -G hadoop
.
Create Home directory for this user on HDFS.
# su - hdfs -c "hdfs dfs -mkdir /user/newuser1" # su - hdfs -c "hdfs dfs -chown newuser1:hadoop /user/newuser1" # su - hdfs -c "hdfs dfs -chmod 755 /user/newuser1"
.
Now you can switch to this "newuser1" and then can work on hdfs like putting a file to HDFS.
# su - newuser1 # hdfs dfs -put /etc/passwd /user/newuser1 # hdfs dfs -cat /user/newuser1/passwd
Created ‎02-21-2019 12:32 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are using Ambari then it is more easy ... as soon as you create a user on HDFS it will automatically create the Home Directory for that user on HDFS and set the permission accordingly.
You can enable this feature via ambari as mentioned in the doc: https://docs.hortonworks.com/HDPDocuments/Ambari-2.6.2.0/bk_ambari-administration/content/create_use...
Created ‎02-27-2019 12:23 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The users can be created using below steps:
a)Get the information from user as to which machine is he working from.
b)create the user in in OS first.
c)Create the user in Hadoop by creating his home folder /user/username in Hadoop
d)make sure that we have 777 permission for temp directory in HDFS
e)using chown command change ownership from Hadoop to user for only his home directory so that he can write into only his directory and not other users.
f)add his name into name node hdfs dfsadmin -refreshUserToGroupMappings
G)If needed set a space limit for the user to limit the amount of data stored by him.hdfs dfsadmin -setSpaceQuota 50g /user/username
