ntp时间同步

1.服务器器信息

服务器IP类型
192.168.235.180
192.168.235.181
192.168.235.182

2.安装ntp服务

所有机器安装ntp服务
centos7需要禁用chrony

systemctl stop chronyd  
systemctl disable chronyd

安装ntp服务

yum install ntp ntpdate -y

systemctl status ntpd #有信新显示表示安装成功

3.主服务配置

vim /etc/ntp.conf

1.把如下四行代码注释掉

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

2.去掉注释,将地址改成网段地址
restrict 192.168.235.0 mask 255.255.255.0 nomodify notrap
添加以下内容

server 127.127.1.0
fudge 127.127.1.0 stratum 10
在这里插入图片描述

4.从服务器配置

vim /etc/ntp.conf

配置如下图:
在这里插入图片描述

5.启动所有节点

systemctl start ntpd.service

systemctl enable ntpd.service

6.判断时间同步是否成功

ntpstat 
或者
ntpq -p

看到synchronised 表示从节点同步成功
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值