Alessandro Federico created AMBARI-14152:
--------------------------------------------

             Summary: Ambari agent logs do not rotate filling up disks
                 Key: AMBARI-14152
                 URL: https://issues.apache.org/jira/browse/AMBARI-14152
             Project: Ambari
          Issue Type: Bug
          Components: ambari-agent
    Affects Versions: 2.1.0
            Reporter: Alessandro Federico


I have deployed HDP 2.3 with Coudbreak 1.0.3 on Openstack Juno. But the log 
file of the ambari-agent is filling up the volume /hadoop/fs1/logs on all the 
VMs. It seems that the logging handler defined in the agent code (class 
logging.handlers.RotatingFileHandler) that should rotate the file when it’s 
size is about 10MB is not working properly for same reason. However, if I 
restart the ambari-agent service in the docker container the log file is 
rotated.

For example, now I have a 71MB log file

{noformat}
[root@docker-ambari tmp]# ll -h /var/log/ambari-agent/
total 173M
-rw-r--r--. 1 root root  71M Dec  2 09:49 ambari-agent.log
-rw-r--r--. 1 root root 102M Nov 18 15:17 ambari-agent.log.1
-rw-r--r--. 1 root root    0 Nov 18 15:17 ambari-agent.out
{noformat}

But if I restart the agent, the handler is invoked and the file is rotated

{noformat}
[root@docker-ambari tmp]# ambari-agent restart
Restarting ambari-agent
Verifying Python version compatibility...
Using python  /usr/bin/python2.6
Found ambari-agent PID: 22209
Stopping ambari-agent
Removing PID file at /var/run/ambari-agent/ambari-agent.pid
tput: No value for $TERM and no -T specified
ambari-agent successfully stopped
tput: No value for $TERM and no -T specified
Verifying Python version compatibility...
Using python  /usr/bin/python2.6
Checking for previously running Ambari Agent...
Starting ambari-agent
Verifying ambari-agent process status...
tput: No value for $TERM and no -T specified
Ambari Agent successfully started
tput: No value for $TERM and no -T specified
Agent PID at: /var/run/ambari-agent/ambari-agent.pid
Agent out at: /var/log/ambari-agent/ambari-agent.out
Agent log at: /var/log/ambari-agent/ambari-agent.log

[root@docker-ambari tmp]# ll -h /var/log/ambari-agent/
total 173M
-rw-r--r--. 1 root root  14K Dec  2 09:51 ambari-agent.log
-rw-r--r--. 1 root root  71M Dec  2 09:51 ambari-agent.log.1
-rw-r--r--. 1 root root 102M Nov 18 15:17 ambari-agent.log.2
-rw-r--r--. 1 root root    0 Dec  2 09:51 ambari-agent.out
{noformat}

Thanks
Ale



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to