测试环境
ntp server centos7.1
client xenserver6.5
目的xenserver到ntp server上同步时间
1.安装ntp
yum install ntp -y
2.编辑配置文件
vi /etc/ntp.conf
修改两处
添加允许连接同步的网段
restrict 192.168.0.0 mask 255.255.255.0 nomodify notrap
添加上层ntp server
server 2.cn.pool.ntp.org iburst
server 1.asia.pool.ntp.org iburst
server 3.asia.pool.ntp.org iburst
具体列表:http://www.pool.ntp.org/zone/cn
3.启动服务
systemctl start ntpd
systemctl enable ntpd
systemctl disable chronyd.service //禁止此服务自启动,否则会影响ntpd服务启动,此服务为rhel7中新的ntp对时服务
4.查看是否正常运行
[root@ntp ~]# ntpstat
synchronised to NTP server (202.162.32.12) at stratum 3
time correct to within 222 ms