I am getting below error while adding services in Ambari UI even /var/run/ambari-server/stack-recommendations/ is present in ambari server with full permission. Details: Ambari Version:188.8.131.52 , HDP version:184.108.40.206-5ambari-error.png
- This can usually happen when you are running ambari server as a Non Root user.
This happens, if the "pid.dir" or "recommendations.dir" is mounted on "tmpfs" then rebooting the host might alter the permissions back to 'root:root' and hence the non root ambari user will again not be able to write to these directories.
I have mentioned a workaround and the explanation of such behavior in the following thread which might help: https://community.hortonworks.com/questions/174301/missing-folders-under-varrunambari-server.html
0. Stop ambari-server
# ambari-server stop
1. Change the PATH for those 3 properties mentioned in the ambari.properties file. Notice instead of using "/var/run". we just use "/var" or it can be some thing else.
pid.dir=/var/ambari-server bootstrap.dir=/var/ambari-server/bootstrap recommendations.dir=/var/ambari-server/stack-recommendations
2. Run the "ambari-server setup" and during the ambari-server setup process, when prompted to Customize user account for ambari-server daemon?, choose y
(Please do not change any other properties)
NOTE: Just to avoid any mistakes it is always better to take ambari DB dump (just to make sure that by mistake we do not make any other db changes)
3. Then restart ambari-server.
# ambari-server start
If this resolved your query/issue then please mark this HCC thread as answered by clicking on "Accept" link on the correct answer, That way it will help other HCC users to quickly find the answers.
Thanks for your solution.
We have changed path /var/run/ambari-server to /var/ambari-server and restarted ambari-server and ambari-agent then /var/ambari-server/stack-recommendations and ambari-server.pid getting created Now We are able to add services in Ambari UI but /var/ambari-server/bootstrap not getting created.
Is it an issue or can we ignore it?
Good to know that you are able to add the services now.
It's actually the OS design. That the "tmpfs" directory contents will be cleaned after the reboot so when the new directory is created then it's permission will be "root:root"
So when we use non root user then the recommended approach is to move the mentioned 3 property path to some other directory so that the directories are not removed by the OS and the permissions are not changed later.
I want to know that bootstarp directory and its uses as its not getting created inside /var/ambari-server/.
"bootstrap.dir": This is the directory on the Ambari Server file system which is used for storing Ambari Agent bootstrap information such as request responses. Mostly used during Agent Bootstrap process: https://github.com/apache/ambari/blob/release-2.6.1/ambari-server/src/main/java/org/apache/ambari/se...
Thank you so much Jay for your support.