Project

General

Profile

action #34510

Add logrotate for logs in OSD

Added by szarate over 3 years ago. Updated over 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
2018-04-09
Due date:
% Done:

0%

Estimated time:
Difficulty:

Description

Currently in OSD under /srv there are the postgreSQL logs being stored (under /srv/PSQL94/data/pg_log), and these can take up some space, these logs should be added to Logrotate so that they don't consume half of the available space or more.

Using a similar policy than the one available for openQA logs is more than enough as a starting point.

AC1: logrotate is enabled for /var/lib/pgsql/data/pg_log
AC2: Salt recipe is provided for logrotate on /var/lib/pgsql/data/pg_log


Related issues

Related to openQA Infrastructure - action #93195: [Alerting] Failed systemd services alert (except openqa.suse.de) on 2021-05-28, logrotate.service on openqaworker-arm-1Resolved2021-05-282021-06-11

History

#1 Updated by mkittler over 3 years ago

  • Assignee set to mkittler

#2 Updated by mkittler over 3 years ago

  • Status changed from New to In Progress

I have already created a salt recipe: https://gitlab.suse.de/mkittler/salt-states-openqa/tree/add_postres_logrotate

Still needs a few adjustments and testing, though.

#4 Updated by mkittler over 3 years ago

  • Status changed from In Progress to Resolved

Seems to work:

[martchus@f225 openQA]$ ssh openqa.suse.de
Have a lot of fun...
martchus@openqa:~> sudo ls -l /var/lib/pgsql/data/pg_log
insgesamt 4542304
-rw-r--r-- 1 root     root            46  3. Apr 14:33 LOGS_FROM_90DAYS
-rw------- 1 postgres postgres 196032740  8. Apr 23:59 postgresql-2018-04-08_000000.log
-rw------- 1 postgres postgres 296377255 10. Apr 00:00 postgresql-2018-04-09_000000.log
-rw------- 1 postgres postgres 378688729 11. Apr 00:00 postgresql-2018-04-10_000000.log
-rw------- 1 postgres postgres 353379024 12. Apr 00:00 postgresql-2018-04-11_000000.log
-rw------- 1 postgres postgres 378424631 13. Apr 00:00 postgresql-2018-04-12_000000.log
-rw------- 1 postgres postgres 365403054 14. Apr 00:00 postgresql-2018-04-13_000000.log
-rw------- 1 postgres postgres 315017823 14. Apr 23:59 postgresql-2018-04-14_000000.log
-rw------- 1 postgres postgres 220045145 15. Apr 23:58 postgresql-2018-04-15_000000.log
-rw------- 1 postgres postgres 313532167 16. Apr 23:59 postgresql-2018-04-16_000000.log
-rw------- 1 postgres postgres 269935782 17. Apr 23:59 postgresql-2018-04-17_000000.log
-rw------- 1 postgres postgres 312042725 18. Apr 23:59 postgresql-2018-04-18_000000.log
-rw------- 1 postgres postgres 332642018 19. Apr 23:59 postgresql-2018-04-19_000000.log
-rw------- 1 postgres postgres 329910530 21. Apr 00:00 postgresql-2018-04-20_000000.log
-rw------- 1 postgres postgres 223566686 21. Apr 23:59 postgresql-2018-04-21_000000.log
-rw------- 1 postgres postgres  80886087 22. Apr 23:49 postgresql-2018-04-22_000000.log
-rw------- 1 postgres postgres 191358007 24. Apr 00:00 postgresql-2018-04-23_000000.log
-rw------- 1 postgres postgres  88139029 24. Apr 09:56 postgresql-2018-04-24_000000.log

(I suppose we had more logs before.)

#5 Updated by szarate over 3 years ago

  • Target version changed from Current Sprint to Done

#6 Updated by okurz 4 months ago

  • Related to action #93195: [Alerting] Failed systemd services alert (except openqa.suse.de) on 2021-05-28, logrotate.service on openqaworker-arm-1 added

Also available in: Atom PDF