0%

RHCSA (EX200) - 配置 NTP

配置 NTP

配置您的系统,使其成为 materials.example.com 的 NTP 客户端。(注:materials.example.comclassroom.example.com 的 DNS 别名)

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
31
32
33
34
35
36
[root@node1 ~]# systemctl list-units | grep NTP
chronyd.service loaded active running NTP client/server
[root@node1 ~]# man -k chrony
chrony.conf (5) - chronyd configuration file
chronyc (1) - command-line interface for chrony daemon
chronyd (8) - chrony daemon
[root@node1 ~]# systemctl is-active chronyd.service; systemctl is-enabled chronyd.service
active
enabled
[root@clear ~]# timedatectl
...
System clock synchronized: no
NTP service: active
[root@clear ~]# vim /etc/chrony.conf
# /etc/chrony.conf
server materials.example.com iburst
...
[root@clear ~]# systemctl restart chronyd.service
[root@clear ~]# timedatectl
...
System clock synchronized: yes
NTP service: active
[root@clear ~]# 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 17 54 -33us[ -208us] +/- 750us