題:配置您的系統,位當前服務器配置一個NTP時間服務器 並 同步時間。html
同步域名:cn.pool.ntp.orgvim
一、安裝chrony服務服務器
yum install -y chrony
二、修改配置文件加入 時間域名。註釋掉第一行添加時間域名。spa
# vim /etc/chrony.confrest
#server 0.rhel.pool.ntp.org iburst server cn.pool.ntp.org iburst server 1.rhel.pool.ntp.org iburst server 2.rhel.pool.ntp.org iburst server 3.rhel.pool.ntp.org iburst
注:能夠吧rhel幾個都註釋掉,因爲沒法ping通,留着會印象效率。code
三、重啓時間服務器、開機自啓server
systemctl restart chronyd
systemctl enable chronyd
四、設置ntp客戶端和服務器同步htm
timedatectl set-ntp true
其餘方法:
blog
命令:chronyc # 立刻同步時間 chronyc> waitsync
五、查看get
timedatectl