티스토리 뷰

Cloud/Private Cloud

journal files

Jacob_baek 2017. 4. 14. 16:26

간혹 journal file이 다수 쌓여 디스크용량을 차지하는 경우가 있다.

이럴 경우 journal.conf를 변경하여 쌓이는 용량을 변경하고 관련파일들을 제거한다.


/etc/systemd/journald.conf 내에 아래 설정을 변경한다.

SystemMaxUse=100M


이후 아래 서비스를 재시작한다.

[root@director9 b4547fd86bc5413898b477b9968e61e1]# systemctl status systemd-journald.service

● systemd-journald.service - Journal Service

   Loaded: loaded (/usr/lib/systemd/system/systemd-journald.service; static; vendor preset: disabled)

   Active: active (running) since 금 2017-04-14 14:09:27 KST; 33min ago

     Docs: man:systemd-journald.service(8)

           man:journald.conf(5)

 Main PID: 592 (systemd-journal)

   Status: "Processing requests..."

   CGroup: /system.slice/systemd-journald.service

           └─592 /usr/lib/systemd/systemd-journald


 4월 14 14:09:26 director9.naimnetworks.com systemd-journal[592]: Runtime journal is using 8.0M (max allowed 3.1G, trying to leave 4.0G free of 31.…it 3.1G).

 4월 14 14:09:26 director9.naimnetworks.com systemd-journal[592]: Permanent journal is using 3.9G (max allowed 4.0G, trying to leave 4.0G free of 1…it 4.0G).

 4월 14 14:09:27 director9.naimnetworks.com systemd-journal[592]: Time spent on flushing to /var is 185.559ms for 1596 entries.

 4월 14 14:09:27 director9.naimnetworks.com systemd-journal[592]: Journal started

Hint: Some lines were ellipsized, use -l to show in full.


강제 삭제방법

journalctl 을 사용하여 삭제를 할 수 있다.

# 2일간의 자료만 남겨둔다.

journalctl --vacuum-time=2d 

# 500MB의 자료만 남겨둔다.

journalctl --vacuum-size=500M


이후 아래 command로 사용중인 용량을 확인할 수 있다.

journalctl --disk-usage


강제로 아래 디렉토리 내에 파일을 삭제해도 무방하다.

/var/log/journal/

다만 파일만 삭제하고 디렉토리를 삭제하면 안된다.


이후 아래와 같은 command로 사용되고 있는 log 용량을 확인할 수 있다.

du -h --max-depth=2 /var/log/


참고사이트

- https://bbs.archlinux.org/viewtopic.php?id=158510

'Cloud > Private Cloud' 카테고리의 다른 글

impossible to access openstack horizon  (0) 2017.09.01
ansible tower  (0) 2017.07.03
RHOSP 9 with LBaasv2  (0) 2017.04.14
blk_update_request I/O error  (0) 2017.04.14
install vlc player on redhat linux  (0) 2017.04.06
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함