Reputation: 337
So There is hdfs:hdfs user/group exists hadoop cluster There are also other users assigned to hdfs which gives write and read access to file system How do I create a new group and add existing users to this group with write and read access to file system ?
Upvotes: 3
Views: 7791
Reputation: 2135
Rightly said in earlier answer. user/groups are strings of characters. Nothing more. Hadoop will very happily let you run a command like
hadoop fs -chown fake_user_not_exists:fake_group_not_exists /test-dir
The downside to doing this is that if that user and group really don’t exist, no one will be able to access that file except the superusers, which, by default, includes hdfs, mapred, and other members of the hadoop supergroup.
Pls read : http://blog.cloudera.com/blog/2012/03/authorization-and-authentication-in-hadoop/
Upvotes: 1
Reputation: 8522
HDFS does not maintain a separate user/group in its file system, instead it uses user/group in the underlying OS like unix. If you create a unix user/groups that can be used in hdfs also.
No need to create a user/group in all nodes in the cluster, Just need to create user/groups in the node through which you access hdfs filesystem.
Once the user/groups is created in unix. Use the following command to change the owner:group name of the file/directory
hadoop fs -chown <USER>:<NEWGROUOP> <path>
Above command should be executed as hdfs user
Upvotes: 4