Linux NTP时间校准服务搭建
warning:
这篇文章距离上次修改已过579天,其中的内容可能已经有所变动。
1、实验环境:
系统:CentOS 7.0
软件版本:ntp-4.2

2、安装步骤:
a、首先打开防火墙,放行UDP 123(NTP默认端口)端口
firewall-cmd --permanent --add-port=123/udp firewall-cmd --reload
b、安装ntp:
yum –y install ntp
c、配置ntp服务
vi /etc/ntp.conf
主要修改
(1)、restrict 192.168.6.2 mask 255.255.255.0 nomodify notrap //集群所在网段的网关(Gateway),子网掩码(Genmask),如果是多外开放,按下图所示,0.0.0.0 允许所有。
(2)、server ntpupdate.tencentyun.com iburst 增加上层ntp校准节点
eg:


d、重启服务,并查看状态,及测试。
systemctl restart ntpd systemctl enable ntpd
查看状态:ntpstat

查看ntp服务器与上层ntp的状态

测试:ntpdate *(你的ntp服务器地址或域名)
