https://access.redhat.com/solutions/696893
SOLUTION 已验证 - 已更新 2019年一月18日00:39 -
环境
- Red Hat Enterprise Linux 7
- Red Hat Enterprise Linux 8
问题
- The
systemdjournal is configured by default to store logs only in a small ring-buffer in/run/log/journal, which is not persistent - Journal database logs do not survive a system reboot
决议
- Configure
systemdto persistently store journal logs in/var/log/journalby running the following commands.
# mkdir -p /var/log/journal
- You may decide if you need to keep or remove the
rsyslogpackage installed on the system at this point, depending on your requirements - See
man journalctlfor more information on querying the journal database for specific logs
Instead of manually creating the /var/log/journal directory, one can also change the systemd-journald configuration file:
# sed -i 's/#Storage=auto/Storage=persistent/' /etc/systemd/journald.conf
# systemctl restart systemd-journald.service
With storage option "persistent", data will be stored preferably on disk, i.e. below the /var/log/journal hierarchy (which is created if needed), with a fallback to /run/log/journal (which is created if needed), during early boot and if the disk is not writable.
根源
- By default in Red Hat Enterprise Linux 7 and 8,
systemdis not configured to maintain logs persistently

在 Red Hat Enterprise Linux 7 和 8 中,systemd 默认将日志存储在 /run/log/journal 的小环形缓冲区中,这在系统重启后会丢失。本文介绍如何通过修改配置,使日志持久保存在 /var/log/journal 目录下。
990

被折叠的 条评论
为什么被折叠?



