Apache Ambari Administration
Also available as:
PDF
loading table of contents...

Enable User Home Directory Creation

A common requirement to initialize user accounts to run Hadoop components is the existence of a unique, /user/<username> HDFS home directory. You can enable automated creation of a /user/<username> HDFS home directory for each user that you create. Home directory creation occurs for users created either manually using the Ambari Admin page, or through LDAP synchronization.

To enable automated user home directory creation, perform the following steps on your Ambari Server host:

Steps.

  1. Edit the ambari-properties file using a command line editor (vi, in this example).

    vi /etc/ambari-server/conf/ambari.properties
  2. Add the following property:

    ambari.post.user.creation.hook.enabled=true.

  3. Add the script path to the ambari properties file:

    ambari.post.user.creation.hook=/var/lib/ambari-server/resources/scripts/post-user-creation-hook.sh

  4. Restart Ambari server.

    ambari-server restart
[Important]Important

In a Kerberized environment, you must modify the kinit file path in the default user creation hook script.

/var/lib/ambari-server/resources/scripts/post-user-creation-hook.sh

After enabling the post-user creation script, Ambari executes the script whenever a user is created and logs a message each time the script is invoked. If the script has a non-zero exit code, an ERROR is logged, otherwise an INFO-level message that includes the script path and parameters is logged.