Support Questions
Find answers, ask questions, and share your expertise

[Solved] HDP 3.1.0 unable to start Namenode (/tmp/user/0/tmp3midk9: Permission denied)

[Solved] HDP 3.1.0 unable to start Namenode (/tmp/user/0/tmp3midk9: Permission denied)

New Contributor

The command to check Safe mode for Namenode is failing with permission denied. (But actually namenode is up)

call['ambari-sudo.sh su hdfs -l -s /bin/bash -c 'curl -sS -L -w '"'"'%{http_code}'"'"'-X GET '"'"'http://XXXX:50070/webhdfs/v1/tmp?op=GETFILESTATUS&user.name=hdfs'"'"'1>/tmp/user/0/tmp3midk9 2>/tmp/user/0/tmp565hhks']

Was able to make it work by chmod /tmp/user/0 and make hdfs be able to write to root owned folder /tmp/user/0, But this doesn't seems like right approach.

Expected: above command should write to /tmp/user/1002 this folder is owned by hdfs and should be fine because it's su hdfs

Is there any way i can pass configuration to fix above.


Update:

This issue appears when libpam-tmpdir is installed on the host, In above case command is constructed by root user and runs as HDFS user. With libpam-tmpdir user specific temp directory are created and this is not yet handled in Ambari 2.7.3(HDP 3.1.0).


Solution:

Uninstall libpam-tmpdir(ubuntu) or pam-tmpdir(debian) from all hosts before adding it to ambari hosts.