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.
Edit the ambari-properties file using a command line editor (vi, in this example).
vi /etc/ambari-server/conf/ambari.properties
Add the following property:
ambari.post.user.creation.hook.enabled=true.
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
Restart Ambari server.
ambari-server restart
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.