4.4. 로그 관리


컨테이너화된 서비스 로그 파일은 /var/log/containers/<service >에 저장됩니다(예: /var/log/containers/cinder ). 컨테이너 내에서 실행 중인 서비스의 로그 파일은 로컬에 저장됩니다. 사용 가능한 로그는 활성화된 서비스 및 비활성화된 서비스에 따라 다를 수 있습니다.

다음 예제에서는 p olkit 작업이 10 MB에 도달할 때 새 로그 파일을 생성하고 14 일 동안 로그 파일을 유지합니다.

parameter_defaults
  LogrotateRotate: '14'
  LogrotatePurgeAfterDays: '14'
  LogrotateMaxsize: '10M'
Copy to Clipboard Toggle word wrap

로그 회전 매개변수를 사용자 지정하려면 환경 템플릿에 이러한 parameter_defaults 를 입력한 다음 오버클라우드를 배포합니다.

openstack overcloud deploy \
--timeout 100 \
--templates /usr/share/openstack-tripleo-heat-templates \
... \
-e /home/stack/templates/rotate.yaml \
--log-file overcloud_deployment_90.log
Copy to Clipboard Toggle word wrap

검증: 모든 오버클라우드 노드에서 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


}
Copy to Clipboard Toggle word wrap

다음 예에서는 nova-compute.log 파일이 한 번 순환되었습니다.

[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 Clipboard Toggle word wrap

로그 파일 순환 프로세스는 VDDK _crond 컨테이너에서 수행됩니다. /var/spool/cron/root 구성 파일이 읽고 프로세스로 전송된 구성을 읽습니다.

검증: 구성이 모든 컨트롤러 노드에 있는지 확인합니다.

[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 Clipboard Toggle word wrap

/var/lib/config-data/puppet-generated/crond/etc/logrotate-crond.conf 파일은 Bugzilla _ crond 컨테이너 내부의 /etc/logrotate-crond.conf 에 바인딩됩니다.

참고

이전 구성 파일은 과거의 이유로 남아 있지만 사용되지 않습니다.

맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat