How to force kolla-ansible to rotate logs with given interval [kolla-ansible]
Hi, different services in kolla-ansible have different log rotation policies and I’d like to make the logs easier to maintain and search (tried central logging with Kibana, but somehow I don’t like this solution). So I tried to write common config file for all logs. As I understand all logs should be rotated by cron container, inside of which there’s logrotate.conf file (and as I can see the logs are rotated according to this file). So I’ve copied this file, modified according to my needs and put it ina /etc/kolla/config with the name cron-logrotate-global.conf (as documentation says). And… nothing. I’ve checked permissions of this file - everything seems to be ok, so what’s the problem? Below is my logrotate.conf file Best regards, Adam Tomas cat /etc/kolla/config/cron-logrotate-global.conf daily rotate 31 copytruncate compress delaycompress notifempty missingok minsize 0M maxsize 100M su root kolla "/var/log/kolla/ansible.log" { } "/var/log/kolla/aodh/*.log" { } "/var/log/kolla/barbican/*.log" { } "/var/log/kolla/ceilometer/*.log" { } "/var/log/kolla/chrony/*.log" { } "/var/log/kolla/cinder/*.log" { } "/var/log/kolla/cloudkitty/*.log" { } "/var/log/kolla/designate/*.log" { } "/var/log/kolla/elasticsearch/*.log" { } "/var/log/kolla/fluentd/*.log" { } "/var/log/kolla/glance/*.log" { } "/var/log/kolla/haproxy/haproxy.log" { } "/var/log/kolla/heat/*.log" { } "/var/log/kolla/horizon/*.log" { } "/var/log/kolla/influxdb/*.log" { } "/var/log/kolla/iscsi/iscsi.log" { } "/var/log/kolla/kafka/*.log" { } "/var/log/kolla/keepalived/keepalived.log" { } "/var/log/kolla/keystone/*.log" { } "/var/log/kolla/kibana/*.log" { } "/var/log/kolla/magnum/*.log" { } "/var/log/kolla/mariadb/*.log" { } "/var/log/kolla/masakari/*.log" { } "/var/log/kolla/monasca/*.log" { } "/var/log/kolla/neutron/*.log" { postrotate chmod 644 /var/log/kolla/neutron/*.log endscript } "/var/log/kolla/nova/*.log" { } "/var/log/kolla/octavia/*.log" { } "/var/log/kolla/rabbitmq/*.log" { } "/var/log/kolla/rally/*.log" { } "/var/log/kolla/skydive/*.log" { } "/var/log/kolla/storm/*.log" { } "/var/log/kolla/swift/*.log" { } "/var/log/kolla/vitrage/*.log" { } "/var/log/kolla/zookeeper/*.log" { }
Hi Adam, We don't currently support customising this file via /etc/kolla/config/cron-logrotate-global.conf. Where did you see it documented? It would be possible to support it by adding a with_first_found loop to the cron task in ansible/roles/common/tasks/config.yml. Mark On Mon, 18 Oct 2021 at 09:23, Adam Tomas <bkslash@poczta.onet.pl> wrote:
Hi, different services in kolla-ansible have different log rotation policies and I’d like to make the logs easier to maintain and search (tried central logging with Kibana, but somehow I don’t like this solution). So I tried to write common config file for all logs. As I understand all logs should be rotated by cron container, inside of which there’s logrotate.conf file (and as I can see the logs are rotated according to this file). So I’ve copied this file, modified according to my needs and put it ina /etc/kolla/config with the name cron-logrotate-global.conf (as documentation says). And… nothing. I’ve checked permissions of this file - everything seems to be ok, so what’s the problem? Below is my logrotate.conf file
Best regards, Adam Tomas
cat /etc/kolla/config/cron-logrotate-global.conf
daily rotate 31 copytruncate compress delaycompress notifempty missingok minsize 0M maxsize 100M su root kolla "/var/log/kolla/ansible.log" { } "/var/log/kolla/aodh/*.log" { } "/var/log/kolla/barbican/*.log" { } "/var/log/kolla/ceilometer/*.log" { } "/var/log/kolla/chrony/*.log" { } "/var/log/kolla/cinder/*.log" { } "/var/log/kolla/cloudkitty/*.log" { } "/var/log/kolla/designate/*.log" { } "/var/log/kolla/elasticsearch/*.log" { } "/var/log/kolla/fluentd/*.log" { } "/var/log/kolla/glance/*.log" { } "/var/log/kolla/haproxy/haproxy.log" { } "/var/log/kolla/heat/*.log" { } "/var/log/kolla/horizon/*.log" { } "/var/log/kolla/influxdb/*.log" { } "/var/log/kolla/iscsi/iscsi.log" { } "/var/log/kolla/kafka/*.log" { } "/var/log/kolla/keepalived/keepalived.log" { } "/var/log/kolla/keystone/*.log" { } "/var/log/kolla/kibana/*.log" { } "/var/log/kolla/magnum/*.log" { } "/var/log/kolla/mariadb/*.log" { } "/var/log/kolla/masakari/*.log" { } "/var/log/kolla/monasca/*.log" { } "/var/log/kolla/neutron/*.log" { postrotate chmod 644 /var/log/kolla/neutron/*.log endscript } "/var/log/kolla/nova/*.log" { } "/var/log/kolla/octavia/*.log" { } "/var/log/kolla/rabbitmq/*.log" { } "/var/log/kolla/rally/*.log" { } "/var/log/kolla/skydive/*.log" { } "/var/log/kolla/storm/*.log" { } "/var/log/kolla/swift/*.log" { } "/var/log/kolla/vitrage/*.log" { } "/var/log/kolla/zookeeper/*.log" { }
Hi Mark, thank you for the answer. I’ve changed ansible/roles/common/templates/cron-logrotate-global.conf.j2 (minsize 0M) and ansible/roles/common/defaults/main.yml (changing cron_logrotate_rotation_interval to „daily” and cron_logrotate_rotation_count to „31") and logrotate.conf inside cron container now has my settings, but… logs still rotates according to default rules (every 6 weeks and only if the log is > than 30M).
Wiadomość napisana przez Mark Goddard <mark@stackhpc.com> w dniu 19.10.2021, o godz. 09:47:
Hi Adam,
We don't currently support customising this file via /etc/kolla/config/cron-logrotate-global.conf. Where did you see it documented?
It would be possible to support it by adding a with_first_found loop to the cron task in ansible/roles/common/tasks/config.yml.
how exactly? Best regards, Adam Tomas
Mark
On Mon, 18 Oct 2021 at 09:23, Adam Tomas <bkslash@poczta.onet.pl> wrote:
Hi, different services in kolla-ansible have different log rotation policies and I’d like to make the logs easier to maintain and search (tried central logging with Kibana, but somehow I don’t like this solution). So I tried to write common config file for all logs. As I understand all logs should be rotated by cron container, inside of which there’s logrotate.conf file (and as I can see the logs are rotated according to this file). So I’ve copied this file, modified according to my needs and put it ina /etc/kolla/config with the name cron-logrotate-global.conf (as documentation says). And… nothing. I’ve checked permissions of this file - everything seems to be ok, so what’s the problem? Below is my logrotate.conf file
Best regards, Adam Tomas
cat /etc/kolla/config/cron-logrotate-global.conf
daily rotate 31 copytruncate compress delaycompress notifempty missingok minsize 0M maxsize 100M su root kolla "/var/log/kolla/ansible.log" { } "/var/log/kolla/aodh/*.log" { } "/var/log/kolla/barbican/*.log" { } "/var/log/kolla/ceilometer/*.log" { } "/var/log/kolla/chrony/*.log" { } "/var/log/kolla/cinder/*.log" { } "/var/log/kolla/cloudkitty/*.log" { } "/var/log/kolla/designate/*.log" { } "/var/log/kolla/elasticsearch/*.log" { } "/var/log/kolla/fluentd/*.log" { } "/var/log/kolla/glance/*.log" { } "/var/log/kolla/haproxy/haproxy.log" { } "/var/log/kolla/heat/*.log" { } "/var/log/kolla/horizon/*.log" { } "/var/log/kolla/influxdb/*.log" { } "/var/log/kolla/iscsi/iscsi.log" { } "/var/log/kolla/kafka/*.log" { } "/var/log/kolla/keepalived/keepalived.log" { } "/var/log/kolla/keystone/*.log" { } "/var/log/kolla/kibana/*.log" { } "/var/log/kolla/magnum/*.log" { } "/var/log/kolla/mariadb/*.log" { } "/var/log/kolla/masakari/*.log" { } "/var/log/kolla/monasca/*.log" { } "/var/log/kolla/neutron/*.log" { postrotate chmod 644 /var/log/kolla/neutron/*.log endscript } "/var/log/kolla/nova/*.log" { } "/var/log/kolla/octavia/*.log" { } "/var/log/kolla/rabbitmq/*.log" { } "/var/log/kolla/rally/*.log" { } "/var/log/kolla/skydive/*.log" { } "/var/log/kolla/storm/*.log" { } "/var/log/kolla/swift/*.log" { } "/var/log/kolla/vitrage/*.log" { } "/var/log/kolla/zookeeper/*.log" { }
participants (2)
-
Adam Tomas
-
Mark Goddard