systemd 日志总是被轮转,有什么办法可以解决吗?
[root@localhost ~]# grep -v ^# /etc/systemd/journald.conf
[Journal]
[root@localhost ~]#
[root@localhost ~]# journalctl --disk-usage
Archived and active journals take up 184.0M on disk.
[root@localhost ~]#
[root@localhost ~]# 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 Fri 2024-08-23 22:28:55 CST; 1 day 15h ago
Docs: man:systemd-journald.service(8)
man:journald.conf(5)
Main PID: 610 (systemd-journal)
Status: "Processing requests..."
CGroup: /system.slice/systemd-journald.service
└─610 /usr/lib/systemd/systemd-journald
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
[root@localhost ~]#
出现这个
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
网上搜了一下,redhat 说不用管它,但日志被轮转了会导致 journalctl 看不了系统日志。
1
ho121 124 天前 via Android 2
|
2
billlee 124 天前
RHEL 还在用 rsyslogd 吗?我记得以前在 RHEL 上 systemd-journald 纯粹就起到吧日志转发个 rsyslogd 的作用,所以默认的配置是 journald 日志不写磁盘,只在 tmpfs 上缓冲一小段
|
4
ranaanna 124 天前 3
1. 首先,日志被轮转并不影响查看。journalctl 会自动读取和组合日志目录中的所有文件,包括轮转产生的 archived 日志
2. 日志一般默认存储在内存中(/run/log/journal ),系统重启日志丢失因此会提示日志输出不完整或 unavailable 。修改/etc/systemd/journald.conf 文件 Storage=persistent ,或其他让日志保存在/var/log/journal 3. 只是一个 warning 而已,确实不用管它 |
5
shum02 124 天前
楼上说得对
|