校時要安裝使用的是NTP
安裝必要的packages
# yum install ntp ntpdate ntp-doc
設定開機就啟動NTP Daemon
# systemctl enable ntpd
手動作系統時間與pool.ntp.org的NTP server做校時。後面再換別台
# ntpdate pool.ntp.org
啟動系統的NTP Daemon
# systemctl start ntpd
# systemctl enable ntpd
若要修改時間
# timedatectl set-timezone Asia/Taipei
設定要校時的NTP server
# vim /etc/ntp.conf
我是加上
server time.google.com
server time.asia.apple.com
這邊每一行server後面加上的是ntp伺服器。
常見的還有這些可以自己選著用
server time.stdtime.gov.tw
server tock.stdtime.gov.tw
server watch.stdtime.gov.tw
server clock.stdtime.gov.tw
server tick.stdtime.gov.tw
檢查校時是否正確運作指令
# ntpstat
防火牆放行
# firewall-cmd –add-service=ntp –permanent
# firewall-cmd –reload
PS: 使用了ntp服務就會自動校時。若是要手動就是使用crontab去跑ntpdate指令