Creating Directories and Changing Ownership

Now let us have a look at how to create directories and manage ownership.

  • By default hdfs is superuser of HDFS
  • hadoop fs -mkdir – to create directories
  • hadoop fs -chown – to change ownership of files
  • chown can also be used to change the group. We can change the group using -chgrp command as well. Make sure to run -help on chgrp and check the details.
  • Creating user space
    • Create directory with user id cloudera under /user
    • Change ownership to the same name as the directory created earlier (/user/cloudera)
    • You can validate permissions by using hadoop fs -ls command on /user
  • Let us create OS users on bigdataserver-1 and then user spaces for cloudera, itversity and demo.
  • We will be using these to demonstrate ACLs.

Share this post