美文网首页
ntp 局域网时间同步 2020-03-17

ntp 局域网时间同步 2020-03-17

作者: 迷藏_ | 来源:发表于2020-03-17 18:11 被阅读0次

这里以centos7 为例,其它系统差不多

主节点

vim /etc/ntp.conf

driftfile /var/lib/ntp/drift
restrict 127.0.0.1
restrict ::1
restrict default nomodify
restrict default nomodify notrap 
#有网络连接时同步阿里云时间
server ntp4.aliyun.com
server 127.127.1.0
fudge 127.127.1.0 stratum 10
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
#添加此处。允许内网其他机器同步。
restrict 192.168.2.0 mask 255.255.255.0 nomodify notrap

从节点

vim /etc/ntp.conf

ftfile /var/lib/ntp/drift
restrict 127.0.0.1
restrict ::1
restrict default nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
#这里是主节点的主机名或者ip
server master
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys

重启服务

systemctl restart ntpd

验证

ntpstat

    synchronised to NTP server (119.28.206.193) at stratum 3
    time correct to within 25 ms
    polling server every 1024 s

相关文章

  • (8)Linux_服务篇_NTP_DHCP

    NTP 描述:中心时间服务器,用于局域网服务器时间同步 安装软件:ntp 1. 配置路径:vim /etc/ntp...

  • ntp 局域网时间同步 2020-03-17

    这里以centos7 为例,其它系统差不多 主节点 vim /etc/ntp.conf 从节点 vim /etc/...

  • ntp同步局域网下的时间

    时间服务器配置 查看ntp是否安装 修改ntp配置文件 修改授权网段,使得该网段的所有机器可以查询和同步本主机的时...

  • 03-MongoDB集群运维-NTP时间同步

    背景 使用 NTP时间同步操作,避免出现因时间不一致导致集群间数据同步问题 NTP时间同步 测试NTP常用服务器是...

  • linux ntp 同步时间

    文章来自:linux ntp 同步时间,linux ntp时间同步的两种方法[https://blog.csdn....

  • ntp时间同步服务

    ntp时间同步服务 概念 NTP是网络时间协议(Network Time Protocol),它是用来同步网络中各...

  • ntp时间同步

    解决的问题: 保证集群中所有的节点时间一致方案: 需要使用同步软件NTP , 并在主机上开启此服务, 其他节点的...

  • ntp时间同步

    检查是否安装ntpd 安装ntpd 配置ntpd 启动ntpd 查看 查看状态 注意: 这个状态要等上几分钟或者一...

  • ntp时间同步

  • ntp时间同步

    ntp时间同步 介绍如果一个集群中,时间相差很大,那么会出现很多诡异的问题,我们也不想在一个无法解决的问题上浪费几...

网友评论

      本文标题:ntp 局域网时间同步 2020-03-17

      本文链接:https://www.haomeiwen.com/subject/qpfxyhtx.html