컨테이너화된 서비스 로그 파일은 /var/log/containers/<service >에 저장됩니다(예: /var/log/containers/cinder ). 컨테이너 내에서 실행 중인 서비스의 로그 파일은 로컬에 저장됩니다. 사용 가능한 로그는 활성화된 서비스 및 비활성화된 서비스에 따라 다를 수 있습니다.
다음 예제에서는 p olkit 작업이 10 MB에 도달할 때 새 로그 파일을 생성하고 14 일 동안 로그 파일을 유지합니다.
Copy to ClipboardCopied!Toggle word wrapToggle overflow
검증: 모든 오버클라우드 노드에서 NFD _crond 가 업데이트되었는지 확인합니다.
[root@compute0 ~]# podman exec -it logrotate_crond cat /etc/logrotate-crond.conf
/var/log/containers/*/*log /var/log/containers/*/*/*log /var/log/containers/*/*err {
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
copytruncate
delaycompress
compress
}
[root@compute0 ~]# podman exec -it logrotate_crond cat /etc/logrotate-crond.conf
/var/log/containers/*/*log /var/log/containers/*/*/*log /var/log/containers/*/*err {
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
copytruncate
delaycompress
compress
}
Copy to ClipboardCopied!Toggle word wrapToggle overflow
다음 예에서는 nova-compute.log 파일이 한 번 순환되었습니다.
ls -lah /var/log/containers/nova/
[root@compute0 ~]# ls -lah /var/log/containers/nova/
total 48K
drwxr-x---. 2 42436 42436 79 May 12 09:01 .
drwxr-x---. 7 root root 82 Jan 21 2021 ..
-rw-r--r--. 1 42436 42436 12K May 12 14:00 nova-compute.log
-rw-r--r--. 1 42436 42436 33K May 12 09:01 nova-compute.log.1
-rw-r--r--. 1 42436 42436 0 Jan 21 2021 nova-manage.log
Copy to ClipboardCopied!Toggle word wrapToggle overflow
로그 파일 순환 프로세스는 VDDK _crond 컨테이너에서 수행됩니다. /var/spool/cron/root 구성 파일이 읽고 프로세스로 전송된 구성을 읽습니다.
검증: 구성이 모든 컨트롤러 노드에 있는지 확인합니다.
podman exec -it logrotate_crond /bin/sh
[root@controller0 ~]# podman exec -it logrotate_crond /bin/sh
()[root@9410925fded9 /]$ cat /var/spool/cron/root
# HEADER: This file was autogenerated at 2021-01-21 16:47:27 +0000 by puppet.
# HEADER: While it can still be managed manually, it is definitely not recommended.
# HEADER: Note particularly that the comments starting with 'Puppet Name' should
# HEADER: not be deleted, as doing so could cause duplicate cron jobs.
# Puppet Name: logrotate-crond
PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh
0 * * * * sleep `expr ${RANDOM} \% 90`; /usr/sbin/logrotate -s /var/lib/logrotate/logrotate-crond.status /etc/logrotate-crond.conf 2>&1|logger -t logrotate-crond
Copy to ClipboardCopied!Toggle word wrapToggle overflow
/var/lib/config-data/puppet-generated/crond/etc/logrotate-crond.conf 파일은 Bugzilla _ crond 컨테이너 내부의 /etc/logrotate-crond.conf 에 바인딩됩니다.