cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime(+8 區)yum install -y ntp(含 ntpdate)ntpdate cn.pool.ntp.org(推薦國內源)crontab -e
# 每 10 分鐘同步一次,日誌打標籤便於追蹤
0-59/10 * * * * /usr/sbin/ntpdate cn.pool.ntp.org | logger -t NTP
| 服務器地址 | 運營單位 | 備註 |
|---|---|---|
| ntp.aliyun.com | 阿里雲 | 雲服務器首選,低延遲 |
| ntp.tencent.com | 騰訊雲 | 同理 |
| cn.pool.ntp.org | NTP 池項目 | 自動就近分配 |
| time.windows.com | 微軟 | 兼容性好 |
| 210.72.145.44 | 中國國家授時中心 | 官方權威源 |
若管理數十台機器,建議搭建一台內網 NTP Server,其他機器指向它同步,減少公網流量並提升精度:
# Server 端 /etc/ntp.conf 關鍵配置
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
server cn.pool.ntp.org prefer iburst
# Client 端只需指向 Server IP
server 192.168.1.100 iburst
firewall-cmd --add-port=123/udp --permanentntpq -p
# 輸出中 * 表示當前同步源,+ 表示候選,達標條件:reach 377、delay/jitter 較小