作者:刘刚michaelup_340 | 来源:互联网 | 2023-05-18 18:29
1、NTP服务器环境介绍操作系统:CentOSLinuxrelease7.2.1511(Core)内核:3.10.0-327.4.5.el7.x86_64主机名:ntp012
1、NTP服务器环境介绍
操作系统:CentOS Linux release 7.2.1511 (Core)
内核:3.10.0-327.4.5.el7.x86_64
主机名:ntp01
2、安装ntp服务
yum -y install ntp
3、修改 ntp配置
(1)driftfile /var/lib/ntp/drift
记录和上级时间服务器的时间差异,默认配置,保留
(2)restrict default nomodify
(3)restrict 127.0.0.1
restrict ::1
允许本机的一切操作,默认策略,保留
(4)restrict ntp.aliyun.com
阿里云NTP服务可修改本NTP服务时间
(5)server ntp.aliyun.com
添加阿里云时间源
4、启动NTP服务
启动:systemctl start ntpd
设置开机自启:systemctl enable ntpd
确认事件源:ntpq -p