Problem
컴퓨트 노드의 nova-compute.log가 지속적으로 쌓이지 않고, 4개만 남고 있음.
nova-compute.log가 없을 경우 미터링 검증 시 이력을 조회할 수 없는 문제 발생.
1. 원인
- fuel과 openstack-ansible 설치 도구에 의해 각각의 log rotate 스크립트가 설치되고 운영됨.
- /etc/logrotate.d/fuel.nodaily, /etc/logrotate.d/nova_log_rotate 화일에 nova-compute.log와 관련된 설정이 중복됨.
/etc/logrotate.d/fuel.nodaily | /etc/logrotate.d/nova_log_rotate |
---|---|
# managed by puppet "/var/log/aodh/*.log" copytruncate compress delaycompress missingok notifempty dateext rotate 4 weekly maxsize 100M su root syslog postrotate
| /var/log/nova/nova-compute.log
|
- nova_log_rotate 실행 전에 fuel.nodaily 스크립트가 먼저 실행되면서 nova-compute.log는 "rotate 4" 설정에 의해 4개만 남게되는 현상 발생
Solution
현재 compute node에는 시스템 로그 이외에 오픈스택 관련 로그는 nova, neutron, ceilometer 로그만 기록됨.
중복 설정을 제거하고, 최대 6개월 치 로그가 쌓이도록 설정 변경
1. fule.nodaily를 삭제하고,
2. 각 프로젝트별 log rotate 작성
- nova => nova_log_rotate
- neutron => neutron_log_rotate
- ceilometer => ceilometer_log_rotate
3. 최대 6개월 치 로그가 쌓이도록 설정
- weekly: rotate 30, maxage 200(roate: 로그화일 갯수, maxage: 유효일)
- daily: rotate 720, maxage 200
- controller node의 swift 및 각 컨테이너 log rotate 설정 변경\
4. fuel.nodaily 스크립트에 존재하는 시스템 로그를 rsyslog에서 관리될 수 있도록 수정
- /var/log/nailgun-agent.log
- /var/log/audit/audit.log
* 적용 내용
controller | /etc/logrotate.d/swift_log_rotate | /var/log/swift/object.log 추가 | |
/var/log/swift/account.log 추가 | |||
rotate 30 | |||
maxage 200 | |||
cinder-api-container | /etc/logrotate.d/cinder_log_rotate | rotate 30 | |
maxage 200 | |||
galera-container | /etc/logrotate.d/galera_log_rotate | rotate 30 | |
maxage 200 | |||
heat-engine-container | /etc/logrotate.d/heat_log_rotate | ||
ironic-compute-container | /etc/logrotate.d/neutron_log_rotate | ||
/etc/logrotate.d/nova_log_rotate | |||
keystone-container | /etc/logrotate.d/keystone_log_rotate | ||
murano-container | /etc/logrotate.d/murano_log_rotate | /var/log/murano/murano-api.log /var/log/murano/murano-engine.log { copytruncate weekly missingok rotate 30 compress dateext maxage 200 notifempty nocreate sharedscripts postrotate systemctl restart rsyslog > /dev/null 2>&1 || true endscript } | |
nova-api-metadata-container | /etc/logrotate.d/nova_log_rotate | ||
nova-conductor-container | /etc/logrotate.d/nova_log_rotate | ||
rabbit-mq-container | /etc/logrotate.d/rabbitmq_log_rotate | ||
/etc/logrotate.d/rabbitmq-server | rotate 30 | ||
cinder-scheduler-container | /etc/logrotate.d/cinder_log_rotate | ||
glance-container | /etc/logrotate.d/glance_log_rotate | ||
ironic-conductor-container | /etc/logrotate.d/ironic_log_rotate | /var/log/ironic/ironic-conductor.log { copytruncate weekly missingok rotate 30 compress dateext maxage 200 notifempty nocreate sharedscripts postrotate systemctl restart rsyslog > /dev/null 2>&1 || true endscript } | |
magnum-container | /etc/logrotate.d/magnum_log_rotate | ||
neutron-agents-container | /etc/logrotate.d/neutron_log_rotate | ||
nova-api-os-compute-container | /etc/logrotate.d/nova_log_rotate | ||
ceilometer-collector-container | /etc/logrotate.d/ceilometer_log_rotate | /var/log/ceilometer/ceilometer-collector.log { copytruncate weekly missingok rotate 30 compress dateext maxage 200 notifempty nocreate sharedscripts postrotate systemctl restart rsyslog > /dev/null 2>&1 || true endscript } | |
cinder-volumes-container | /etc/logrotate.d/cinder_log_rotate | ||
heat-apis-container | /etc/logrotate.d/heat_log_rotate | ||
ironic-api-container | /etc/logrotate.d/ironic_log_rotate | /var/log/ironic/ironic_error.log /var/log/ironic/ironic_access.log { copytruncate weekly missingok rotate 30 compress dateext maxage 200 notifempty nocreate sharedscripts postrotate systemctl restart rsyslog > /dev/null 2>&1 || true endscript } | |
neutron-server-container | /etc/logrotate.d/neutron_log_rotate | ||
nova-api-placement-container | /etc/logrotate.d/nova_log_rotate | ||
nova-scheduler-container | /etc/logrotate.d/nova_log_rotate | ||
swift-proxy-container | /etc/logrotate.d/swift_log_rotate | ||
compute | /etc/logrotate.d/fuel.nodaily 삭제 | ||
/etc/logrotate.d/neutron_log_rotate | rotate 30 maxage 200 | ||
/etc/logrotate.d/nova_log_rotate | daily rotate 720 maxage 200 | ||
/etc/logrotate.d/ceilomter_log_rotate | rotate 30 maxage 200 | ||
/etc/logrotated/rsyslog/ | /var/log/nailgun-agent.log /var/log/audit/audit.log |
- Openstack-Ansible 설치 전 위 내용 수정 필요.
'Cloud > Iaas' 카테고리의 다른 글
galera new cluster (0) | 2021.03.02 |
---|---|
manila 설치 가이드 (0) | 2020.08.11 |