Support Questions

Find answers, ask questions, and share your expertise
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

ambari-agent logs clean


I'm looking for a solution to clean logs of ambari-agent in HDP 3.1.4

I would like to keep logs during a retention period, and delete them after.

Can I configure this clean in the configuration file ambari-agent.ini, or do I need to use another system like logrotate ?

Thanks in advance


Super Collaborator


To enable rotation  for the ambari-agent, follow below steps:

  1. cp /etc/ambari-agent/conf/logging.conf.sample /etc/ambari-agent/conf/logging.conf 
  2. Change the following line:
    args=('/var/log/ambari-agent/ambari-agent.log',"a", 10000000, 25)
    Where: The value 10000000 is the maximum size of the logs in bytes and the value 25 is the number of old logs to keep after the log rotates.
  3. Restart the ambari-agent after making the changes. 
Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.