Step 5: Create the HDFS Superuser
To be able to create home directories for users, you will need access to the HDFS superuser account. (CDH automatically created the HDFS superuser account on each cluster host during CDH installation.) When you enabled Kerberos for the HDFS service, you lost access to the default HDFS superuser account using sudo -u hdfs commands. Cloudera recommends you use a different user account as the superuser, not the default hdfs account.
Designating a Non-Default Superuser Group
To designate a different group of superusers instead of using the default hdfs account, follow these steps:
- Go to the Cloudera Manager Admin Console and navigate to the HDFS service.
- Click the Configuration tab.
- Select .
- Select .
- Locate the Superuser Group property and change the value to the appropriate group name for your environment. For example, <superuser>.
- Click Save Changes to commit the changes.
- Restart the HDFS service.
To enable your access to the superuser account now that Kerberos is enabled, you must now create a Kerberos principal or an Active Directory user whose first component is <superuser>:
If you are using Active DirectoryAdd a new user account to Active Directory, <superuser>@YOUR-REALM.COM. The password for this account should be set to never expire.
If you are using MIT KDC
- In the kadmin.local or kadmin shell, type the following command to create a Kerberos principal called <superuser>:
kadmin: addprinc <superuser>@YOUR-LOCAL-REALM.COMThis command prompts you to create a password for the <superuser> principal. You should use a strong password because having access to this principal provides superuser access to all of the files in HDFS.
- To run commands as the HDFS superuser, you must obtain Kerberos credentials for the <superuser> principal. To do so, run the following command
and provide the appropriate password when prompted.
$ kinit <superuser>@YOUR-LOCAL-REALM.COM