- 逆向行駛 - https://520.be -

Chrony – 新款的NTP系統校時工具

麻倉憂 Yu Asakura

Chrony [1]是CentOS 7發行之後用來取代ntp的系統校時工具,安裝設定都很簡易,留個操作筆記~ 🤖🤓🤖

# 變更伺服器的時區設定

sudo timedatectl set-timezone Asia/Taipei
sudo timedatectl set-ntp yes

# 安裝Chrony系統校時工具

yum install -y epel-release sudo
sudo yum install -y chrony

# 更換伺服器並啟動該服務


# 防火牆設定
systemctl iptables stop
iptables -A INPUT -p tcp --dport 123 -j ACCEPT
iptables-save | tee /etc/sysconfig/iptables
systemctl restart iptables

# firewalld切換成下列指令
firewall-cmd --permanent --add-service=ntp
firewall-cmd --reload

# 對時
sudo chronyc -a makestep && timedatectl

# 查看與ntp server的同步狀態與ntp server的時間差
sudo chronyc sources -v && timedatectl

# 顯示有關系統時間的資訊
sudo chronyc tracking

# 顯示同步源頭的資訊
sudo chronyc sourcestats -v

ref.