linux 集群 NTP时钟服务搭建

卸载系统自带的Chrony:

注意:一下都是root下操作

rpm -qa|grep -i chrony

rpm -e chrony-2.1.1-3.el7.centos.x86_64

下载ntp:

yum install ntp -y

配置NTP-Server端:

vi /etc/ntp.conf
driftfile /var/lib/ntp/drift

restrict default nomodify notrap nopeer noquery

restrict 127.0.0.1 
restrict ::1

restrict 10.***.***.*** mask 255.255.255.0 nomodify notrap
#允许内网其他机器同步时间

includefile /etc/ntp/crypto/pw

keys /etc/ntp/keys

server 127.127.1.0  #主机与自己时间校准
fudge  127.127.1.0 stratum 10 #找不到ntp服务也与自己校准

配置NTP-Client端:

vi /etc/ntp.conf
driftfile /var/lib/ntp/drift

restrict 127.0.0.1 

restrict -6 ::1

includefile /etc/ntp/crypto/pw

keys /etc/ntp/keys

server 10.***.***.*** #ntp主机地址 以10.***.***.***时间作为时间服务
restrict  10.***.***.*** nomodify notrap noquery #允许上层服务器修改本机时间

重启ntp

systemctl restart ntpd

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值