所有节点配置NTP服务

主节点:

打开vim /etc/ntp.conf文件

 1  For more information about this file, see the man pages
 2 # ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).
 3 
 4 driftfile /var/lib/ntp/drift
 5 
 6 # Permit time synchronization with our time source, but do not
 7 # permit the source to query or modify the service on this system.
 8 restrict default kod nomodify notrap nopeer noquery
 9 #restrict -6 default kod nomodify notrap nopeer noquery
10 
11 # Permit all access over the loopback interface.  This could
12 # be tightened as well, but to do so would effect some of
13 # the administrative functions.
14 restrict 192.168.133.131 nomodify notrap nopeer noquery #该节点的IP地址
15 restrict 127.0.0.1
16 restrict -6 ::1
17 
18 # Hosts on local network are less restricted.
19 restrict 192.168.133.2 mask 255.255.255.0 nomodify notrap #网关和子网掩码
20 
21 # Use public servers from the pool.ntp.org project.
22 # Please consider joining the pool (http://www.pool.ntp.org/join.html).
23 #server 0.rhel.pool.ntp.org iburst
24 57 lines yanked    
25 
26 server  127.127.1.0
27 fudge   127.127.1.0 stratum 8

从节点

vim vim /etc/ntp.conf

 1 # For more information about this file, see the man pages
 2 # ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).
 3 
 4 driftfile /var/lib/ntp/drift
 5 
 6 # Permit time synchronization with our time source, but do not
 7 # permit the source to query or modify the service on this system.
 8 restrict default  nomodify notrap nopeer noquery
 9 #restrict -6 default kod nomodify notrap nopeer noquery
10 
11 # Permit all access over the loopback interface.  This could
12 # be tightened as well, but to do so would effect some of
13 # the administrative functions.
14 
15 restrict 192.168.133.129  nomodify notrap nopeer noquery#该节点IP地址
16 restrict 127.0.0.1
17 restrict -6 ::1
18 
19 # Hosts on local network are less restricted.
20 restrict 192.168.133.2 mask 255.255.255.0 nomodify notrap
21 
22 
23 
24 #server 2.rhel.pool.ntp.org iburst
25 #server 3.rhel.pool.ntp.org iburst
26 server 192.168.133.136 #主机IP地址
27 fudge 192.168.133.136 stratum 8

 

转载于:https://www.cnblogs.com/wangleBlogs/p/9619286.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值