美文网首页
NTP本地时间同步

NTP本地时间同步

作者: naxxm | 来源:发表于2019-10-28 12:13 被阅读0次

服务端:

  1. 安装时间同步服务:
yum  -y  install  ntp  ntpdate
  1. 修改配置文件:
vim  /etc/ntp.conf
restrict  10.246.91.0  mask  255.255.255.0  nomodify  notrap                          #打开第16行的注释
server  127.127.1.0  iburst                                                                                      #添加本地作为时间,内网环境注释掉其他server配置
  1. 重启服务并查看状态:
systemctl  restart  ntpd
systemctl  status  ntpd

4.若可连接外网,就用网络时间,否则手动设置时间

date  -s  19\10\28
date  -s  10:50:00

客户端

  1. 执行如下命令
[root@i-4c46d2bc ~]# ntpdate -u 192.168.1.1
28 Oct 11:28:55 ntpdate[6680]: step time server 192.168.1.1 offset 28800.660626 sec

2.创建定时任务

crontab -e
*/5 * * * * /usr/sbin/ntpdate  -u 192.168.1.1 && hwclock -w

参考文档

https://blog.csdn.net/xrwwuming/article/details/51496232
https://blog.csdn.net/hellboy0621/article/details/81903091

本文由博客一文多发平台 OpenWrite 发布!

相关文章

  • NTP本地时间同步

    服务端: 安装时间同步服务: 修改配置文件: 重启服务并查看状态: 4.若可连接外网,就用网络时间,否则手动设置时...

  • 笔记 时间同步服务器搭建

    ntp配置 需要搭建本地的时间同步服务器(非授时)参考:1.CentOS 6 安装 NTP Server 时间服务...

  • Python检查和同步本地时间北京时间!

    背景 有时本地服务器的时间不准了,需要同步互联网上的时间。 解决方案 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本地时间同步

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