配置chrony服務,實現服務器時間自動同步


1、准備工作: 服務器端: 192.168.44.7 系統:centos7

客戶端:192.168.44.6    系統: centos6

2、安裝軟件,啟動服務

yum install chrony

systemctl start chronyd

systemctl enable chronyd

 

 

3、對chrony的配置文件進行修改,配置服務器端

#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server 192.168.44.7 iburst ##設置服務器的ip地址

允許服務的ip網段    

# Allow NTP client access from local network.
allow 192.168.44.0/24 ##設置允許的ip網段

# Serve time even if not synchronized to a time source.
local stratum 10 ##開啟,即使server指令中時間服務器不可用,也允許將本地時間作為標准時間授予其他客戶端

 

 

4、客戶端設置

yum install chrony

service  chrony   start

配置文件中,指向chrony服務器地址就好了

service  chrony   restart

 

 

5、測試

將centos6的時間改錯,只要重啟chrony服務,時間便會同步

chronyc sources -v 查看同步時間的狀態

 

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM