chrony時間同步服務配置
1.安裝服務(一般伺服器都預設安裝了的)
[root@disasterproofapp ~]# yum install -y chrony
2.修改時間同步配置檔案
[root@disasterproofapp ~]# vi /etc/chrony.conf
#server 0.centos.pool.ntp.org iburst --注釋這行
#server 1.centos.pool.ntp.org iburst --注釋這行
#server 2.centos.pool.ntp.org iburst --注釋這行
server ntp.ntsc.ac.cn iburst --添加這行,表示與本機同步時間(視情況自行更改)
3.啟動服務
[root@disasterproofapp ~]# systemctl restart chronyd
4.開機自啟
[root@disasterproofapp ~]# systemctl enable chronyd
5.手動測試同步
[root@disasterproofapp ~]# 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