Bug 1638509
| Summary: | No log rotation configured for Nova logs | ||
|---|---|---|---|
| Product: | Red Hat OpenStack | Reporter: | Archit Modi <amodi> |
| Component: | puppet-tripleo | Assignee: | Martin Schuppert <mschuppe> |
| Status: | CLOSED DUPLICATE | QA Contact: | nlevinki <nlevinki> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 14.0 (Rocky) | CC: | jjoyce, jschluet, mschuppe, nlevinki, slinaber, tvignaud |
| Target Milestone: | --- | Keywords: | Triaged |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-10-12 08:03:34 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Archit Modi
2018-10-11 19:00:24 UTC
There is now a logrotate_crond container which rotates the logs:
$ docker ps | grep log
60427742db80 192.168.24.1:8787/rhosp14/openstack-cron:2018-10-10.1 "kolla_start" 18 hours ago Up 18 hours logrotate_crond
(undercloud) [stack@undercloud-0 ~]$ docker exec -it -u root logrotate_crond /bin/bash
()[root@60427742db80 /]# cat /etc/logrotate-crond.conf
/var/log/containers/*/*log /var/log/containers/*/*/*log {
daily
rotate 14
maxage 14
# minsize 1 is required for GDPR compliance, all files in
# /var/log/containers not managed with logrotate will be purged!
minsize 1
# Do not use size as it's not compatible with time-based rotation rules
# required for GDPR compliance.
maxsize 10M
missingok
notifempty
delaycompress
compress
sharedscripts
postrotate
/usr/bin/find /var/log/containers -type f \
\( -mtime +14 -or \
-atime +14 -or \
-ctime +14 \) -exec rm -f {} \;;
/sbin/lsof -nPs +L1 +D /var/log/containers 2>/dev/null|\
grep -v /var/log/httpd/ |\
awk '/\S+\s+[0-9]+\s.*\/var\/log\/.*\(deleted\)/ {print $2}' |\
sort -u | /bin/xargs -n1 -r -t kill -HUP;
/sbin/lsof -nPs +L1 +D /var/log/containers 2>/dev/null|\
awk '/\S+\s+[0-9]+\s.*\/var\/log\/httpd\/.*\(deleted\)/ {print $2}' |\
sort -u | /bin/xargs -n1 -r -t kill -USR1
endscript
}
[root@controller-0 ~]# ll /var/log/containers/nova/
total 45400
-rw-r--r--. 1 42436 42436 9916939 Oct 12 07:43 nova-api.log
-rw-r--r--. 1 42436 42436 1260924 Oct 12 00:00 nova-api.log.1
-rw-r--r--. 1 42436 42436 402253 Oct 11 23:01 nova-api.log.2.gz
-rw-r--r--. 1 42436 42436 150567 Oct 11 15:04 nova-conductor.log.1
-rw-r--r--. 1 42436 42436 146496 Oct 11 15:04 nova-consoleauth.log.1
-rw-r--r--. 1 42436 42436 0 Oct 12 00:01 nova-manage.log
-rw-r--r--. 1 42436 42436 283125 Oct 11 14:58 nova-manage.log.1
-rw-r--r--. 1 42436 42436 758492 Oct 11 15:05 nova-metadata-api.log.1
-rw-r--r--. 1 42436 42436 146048 Oct 12 07:43 nova-novncproxy.log
-rw-r--r--. 1 42436 42436 169327 Oct 11 23:59 nova-novncproxy.log.1
-rw-r--r--. 1 42436 42436 7780705 Oct 12 07:43 nova-placement-api.log
-rw-r--r--. 1 42436 42436 9654455 Oct 12 00:00 nova-placement-api.log.1
-rw-r--r--. 1 42436 42436 0 Oct 12 00:01 nova-rowsflush.log
-rw-r--r--. 1 42436 42436 3970530 Oct 12 07:43 nova-scheduler.log
-rw-r--r--. 1 42436 42436 4800002 Oct 12 00:00 nova-scheduler.log.1
Your issue is a duplicate of [1] and gets addressed by [2], which is not merged yet for rocky. There are services which do not tolerate SIGHUP, or support them nicely. That's why it result sometimes to not rotate them correct. The fix config to fallback to copytruncate containerized logs.
I am going to close this as a dupe of [1], but feel free to reopen if I have missed something.
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1614810
[2] https://review.openstack.org/#/c/607491/
[3] https://review.openstack.org/#/c/608594/
*** This bug has been marked as a duplicate of bug 1614810 ***
|