mandb
man -k journal
man 5 journald.conf , Storage=
[root@clear journal]# cp -a /run/log/journal/ /var/log/journal
[root@clear journal]# ll -d /var/log/journal
drwxr-sr-x. 4 root systemd-journal 86 Nov 19 04:30 /var/log/journal
[root@clear journal]# systemctl restart systemd-journald
[root@clear journal]# ll /var/log/journal/3a2b4da8dabb4729935c193e58ad052d/ #字符串目录名字每个人的可能不一样。不要复制我的笔记。
total 8192
-rw-r-----. 1 root root 8388608 Nov 19 04:30 system.journal
9.保持准确的系统时间
[root@servera log]# timedatectl
Local time: Sat 2020-02-29 08:51:49 CST
Universal time: Sat 2020-02-29 00:51:49 UTC
RTC time: Sat 2020-02-29 08:11:07
Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
[root@servera log]# timedatectl list-timezones
[root@servera log]# timedatectl set-timezone Asia/Hong_Kong
[root@servera log]# timedatectl
Local time: Sat 2020-02-29 08:55:48 HKT
Universal time: Sat 2020-02-29 00:55:48 UTC
RTC time: Sat 2020-02-29 08:15:06
Time zone: Asia/Hong_Kong (HKT, +0800)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
修改时间方法
timedatectl set-time "2020-02-30 10:00:00"
Failed to set time: NTP unit is active
timedatectl set-ntp false
timedatectl set-time "2020-02-30 10:00:00"
timedatectl set-ntp true
10.chrony
[root@servera ~]# systemctl enable --now chronyd
[root@servera ~]# systemctl status chronyd
[root@servera ~]# vim /etc/chrony.conf #大概第7行 server 后面添加服务器'地址'或'域名'。
server classroom.exmaple.com iburst
[root@servera ~]# systemctl restart chronyd.service
[root@servera ~]# chronyc sources -v
210 Number of sources = 1
.-- Source mode '^' = server, '=' = peer, '#' = local clock.
/ .- Source state '*' = current synced, '+' = combined , '-' = not combined,
| / '?' = unreachable, 'x' = time may be in error, '~' = time too variable.
|| .- xxxx [ yyyy ] +/- zzzz
|| Reachability register (octal) -. | xxxx = adjusted offset,
|| Log2(Polling interval) --. | | yyyy = measured offset,
|| \ | | zzzz = estimated error.
|| | | \
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* classroom.example.com 8 6 377 25 -3837ns[ +21us] +/- 627us
[root@node1 ~]# timedatectl
Local time: Sat 2022-11-19 05:03:30 EST
Universal time: Sat 2022-11-19 10:03:30 UTC
RTC time: Sat 2022-11-26 06:07:04
Time zone: America/New_York (EST, -0500)
System clock synchronized: yes #表示时间服务同步
NTP service: active
RTC in local TZ: no