Centos7 内网时间同步服务

所有服务器安装ntp(服务器启动ntpd,客户端关闭ntpd)

服务端配置

服务器关闭防火墙或者开发123端口用于同步时间使用

  • yum install -y ntp
  • systemctl stop firewalld
  • systemctl disable firewalld

修改ntp服务端配置文件(注释掉其他server 数字 主机地址)

vi /etc/ntp.conf

添加修改

restrict 192.168.5.0 mask 255.255.255.0 nomodify notrap #运行哪个子网时间同步
server 127.127.1.0
fudge 127.127.1.0 stratun 10
service master

保存退出

开机自启动

systemctl enable ntpd

重启ntpd

systemctl restart ntpd

查看ntpd

 watch ntpq -p

客户端配置

  • yum install -y ntp
  • systemctl disable ntpd
  • systemctl stop ntpd
  • ps -ef|grep ntpd
  • kill -9 进程id

同步时间

crontab -e
添加
*/1 * * * * /usr/sbin/ntpdate master
保存退出
  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值