红帽RHCE考试上午-RHCSA(RH200)
servera.example.com 任务
7. 配置NTP
• 配置servera作为NTP的客户端,跟时间服务器172.25.254.254同步时间。
题目内容解析:
• 首选需要安装时间服务chrony,运行并设置为开机自启
• 配置同步时间服务的配置文件,设置时间的服务器为172.25.254.254
实操演示过程:
安装chrony时间同步服务
[root@servera managers]# yum install -y chrony
............
Complete!
启动chrony服务并设置为开机自启
[root@servera ~]# systemctl enable chronyd
[root@servera ~]# systemctl start chronyd
配置chrony时间同步服务器的配置文件
[root@servera managers]# vim /etc/chrony.conf
新增的内容如下:
server 172.25.250.254 iburst
重启chrony服务
[root@servera managers]# systemctl restart chronyd
验证与时间服务器的时间差
[root@servera managers]# chronyc sources -v
.-- Source mode '^' = server, '=' = peer, '#' = local clock.
/ .- Source state '*' = current best, '+' = combined, '-' = not combined,
| / 'x' = may be in error, '~' = too variable, '?' = unusable.
|| .- 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
===============================================================================
^- time.cloudflare.com 3 6 17 16 +1620us[+1613us] +/- 94ms
^* 111.230.189.174 2 6 17 15 -647us[ -653us] +/- 17ms
^+ time.neu.edu.cn 1 6 17 16 +594us[ +588us] +/- 31ms
^? 172.25.254.254 0 7 0 - +0ns[ +0ns] +/- 0ns
[root@servera yum.repos.d]# nslookup 172.25.254.254