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

How to remove ambari-agent from host?

Rising Star

Hi. I want to change ambari-agent user to non-root. Documentation says that I should manually install ambari-agent. What if I installed it using Ambari (it is not manually install)? Do I have to remove ambari-agent and install it manually then to configure it for non-root user?

2 REPLIES 2

Cloudera Employee

@Mateusz Grabowski

You don't need to remove the ambari-agent. You can create a dedicated user for ambari agent, like "ambari" user.

Then grant sudo permission to that user, and config the ambari agent property in the /etc/ambari-agent/conf/ambari-agent.ini file, as illustrated below:

run_as_user=ambari

There is a reference for how to configure an ambari agent for non-root

https://docs.hortonworks.com/HDPDocuments/Ambari-2.5.0.3/bk_ambari-security/content/how_to_configure...

Rising Star

@ywang

Thanks for the answer.

But the problem is that when I changed parameter:

run_as_user=ambari-pkt

I could not run a couple of services, for example Oozie:

40586-oozie-ambari-agent-blad.png

I noticed that te ambari-agent does not have permission to directory:

/var/lib/ambari-agent/

This is how the directory looks like:

40587-oozie-ambari-agent-blad-2.png

The question is - what I should do? Remove ambari-agent and install it again or simple chown is enough?

chown -R ambari-pkt /var/lib/ambari-agent<br>