ntp服务搭建(主从)

本文仅供快速搭建用 具体其他功能移步百度学习

主服务器

$ yum install -y ntp
$ vi /etc/ntp.conf 
restrict 192.168.252.240 nomodify notrap nopeer noquery
server 127.127.1.0
Fudge 127.127.1.0 stratum 10
$ service ntpd start
$ chkconfig ntpd on

从服务器

$ yum install -y ntp
$ vi /etc/ntp.conf 
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server 192.168.252.240
$ systemctl start ntpd

查看是否同步成功 

$ ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 base_services   LOCAL(0)         6 u    7   64    1    1.011  -102.74   0.001


版权声明:本文为weixin_46110310原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。