Centos 8 Install NTP Chrony

Centos 8 Install NTP Chrony_第1张图片

安装Chrony来配置NTP服务器以实现时间同步 

shell: dnf -y install chrony 

要安装NTPStat

shell: dnf -y install ntpstat 

显示时间同步状态

shell: ntpstat 
synchronised to NTP server (202.112.29.82) at stratum 3
   time correct to within 20 ms
   polling server every 64 s

安装和配置Chrony

shell: vi /etc/chrony.conf
# line : change servers to synchronize (replace to your own timezone NTP server)
#need NTP server itself to sync time with other NTP server
pool 202.112.29.82 iburst

#line 24: add network range to allow to receive time synchronization requests from NTP Clients
# specify your local network and so on
# if not specified, only localhost is allowed
allow 192.168.3.0/24

启动Chrony

shell: systemctl enable --now chronyd 

防火墙设置

shell: firewall-cmd --add-service=ntp --permanent  && firewall-cmd --reload 

你可能感兴趣的:(Centos)