第一步:

选择一个服务器作为时间同步服务器,如IC-1(IP:192.168.1.101)

在IC-1中,编辑文件/etc/ntp.conf

# For more information about this file, see the man pages

# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).

driftfile /var/lib/ntp/drift

# Permit time synchronization with our time source, but do not

# permit the source to query or modify the service on this system.

restrict default kod nomodify notrap nopeer noquery

restrict -6 default kod nomodify notrap nopeer noquery

# Permit all access over the loopback interface. This could

# be tightened as well, but to do so would effect some of

# the administrative functions.

restrict 127.0.0.1

restrict -6 ::1

# Hosts on local network are less restricted.

#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

# Use public servers from the pool.ntp.org project.

# Please consider joining the pool (http://www.pool.ntp.org/join.html).

#server 0.rhel.pool.ntp.org iburst

#server 1.rhel.pool.ntp.org iburst

#server 2.rhel.pool.ntp.org iburst

#server 3.rhel.pool.ntp.org iburst

server 127.127.1.0

fudge 127.127.1.0 stratum 10

#broadcast 192.168.1.255 autokey # broadcast server

#broadcastclient # broadcast client

#broadcast 224.0.1.1 autokey # multicast server

#multicastclient 224.0.1.1 # multicast client

#manycastserver 239.255.254.254 # manycast server

#manycastclient 239.255.254.254 autokey # manycast client

# Enable public key cryptography.

#crypto

includefile /etc/ntp/crypto/pw

# Key file containing the keys and key identifiers used when operating

# with symmetric key cryptography.

keys /etc/ntp/keys

# Specify the key identifiers which are trusted.

#trustedkey 4 8 42

# Specify the key identifier to use with the ntpdc utility.

#requestkey 8

# Specify the key identifier to use with the ntpq utility.

#controlkey 8

# Enable writing of statistics records.

#statistics clockstats cryptostats loopstats peerstats

如上配置,其中

server 127.127.1.0

fudge 127.127.1.0 stratum 10

是新加的配置,这是让本机的ntpd和本地硬件时间同步。

#server 0.rhel.pool.ntp.org iburst

#server 1.rhel.pool.ntp.org iburst

#server 2.rhel.pool.ntp.org iburst

#server 3.rhel.pool.ntp.org iburst

为注释掉的配置信息。

第二步,启动服务:

/etc/init.d/ntpd start

第三步,在其他节点,开启定时任务,同步时间即可

crontab -e

01   *   *   *   * ntpdate 192.168.1.101

linux指向域同步时间,linux在局域网下设置时间同步相关推荐

  1. linux系统怎么样同步时间,Linux系统时间同步

    在Linux环境下可以通过自带的NTP(Network Time Protocol)协议通过网络使系统保持精确时间, NTP是用来使系统和一个精确的时间源保持时间同步的协议.最好的方法是在自己管理的网 ...

  2. linux ntpdate 查看同步时间,linux ntp ntpdate 同步时间

    ntp同步时间实验 服务端IP 192.168.1.101 客户端 192.168.1.88 一.登录server端 1.首先配置ntpd服务 vi /etc/ntp.conf 配置文件中一般有res ...

  3. linux怎么和宿主机同步时间,Linux 中设置和同步时间

    准确的系统时间是稳定服务的基础,本文介绍与时间相关的Linux命令,以及如何为自己的Linux服务器维护准确的时间. 时间 一台Linux服务器有两个时间源,一个是硬件时间,即服务器硬件CMOS维护的 ...

  4. 每天凌晨2点同步时间linux,linux时间同步的几种方法

    方法1:与一个已知的时间服务器同步 复制代码 代码如下: ntpdate time.nist.gov 其中 time.nist.gov 是一个时间服务器. 删除本地时间并设置时区为上海 复制代码 代码 ...

  5. linux系统怎么同步时间不对,linux系统同步系统时间

    业务场景 由于开发用的laravel框架,业务中用了很多job定时任务,时间几乎分布在全天的任何时间点(精确到秒),如果服务器时间校准出现时间跳跃的话,很有可能导致某些计划任务无法执行. 实现方法分析 ...

  6. linux ntp 同步时间,linux ntp时间同步的两种方法

    服务端IP 192.168.1.101      客户端IP 192.168.1.88 1.首先配置ntpd服务器: vi /etc/ntp.conf 配置文件中有restrict default语句 ...

  7. hid在linux上的轮训时间,LINUX下USB1.1设备学习小记(6)_hid与input子系统(1)

    现在终于开始匹配设备的接口驱动了 目标当然是hid,当然在了解驱动初始化过程之前,让我们先看看一下hid协议 我对hid协议的理解是建立在鼠标上的,所以如果有理解不当的地方,请务必请大家指出 我们先来 ...

  8. 哪些是Linux内核的同步机制,Linux内核的同步机制(1)

    Linux内核的同步机制(1) yanqin | 2009-04-16 14:51:09    阅读:791 发布文章 一. 引言 %A %A 在现代操作系统里,同一时间可能有多个内核执行流在执行,因 ...

  9. linux双系统切换时间,linux与windows双系统下时间不一致的解决办法

    装完win7和Linux双系统后,进入Linux后再进入Windows,你会惊奇的发现时间不对了,差了有8个小时. 导致这样的原因是Winows和 Linux 对硬件时间的处理方法不同,Windows ...

最新文章

  1. requests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine('',))
  2. 费用流 -- 四川省赛F-Direction Setting [拆边成点+费用流]
  3. bzoj1066 蜥蜴 (dinic)
  4. android 锁屏
  5. 接口作为参数,不同的接口调用不同的方法,例如:输出“I love Game”或输出“我喜欢游戏”...
  6. centos7.3挂在移动硬盘(亲测)
  7. 关于本Blog无法进行评论问题的说明
  8. .NET Core开发实战(第14课:自定义配置数据源:低成本实现定制化配置方案)--学习笔记...
  9. java excel中删除两列_Java 插入、隐藏/显示、删除Excel行或列
  10. python解析xml+得到pascal voc xml格式用于目标检测+美化xml
  11. keepalived+LVS实现高可用的Web负载均衡
  12. Java判断字符串是否为纯数字(0-9)
  13. 浏览器市场 Chrome 仍占主导地位,IE 继续下降
  14. EXECUTE IMMEDIATE oracle介绍
  15. html读取在线文件,javascript中如何读取文件?
  16. 扩散方程——热传导问题(能量定律+傅里叶热传导定律)+ 拉普拉斯方程 | 偏微分方程(三)
  17. 概率图模型之隐马尔可夫模型
  18. excel-中心趋势-基本函数-离散程度-四分位数QUARTILE.EXC-画箱线图-标准差
  19. HttpClient 同时支持发送http及htpps请求
  20. 王国两位君主 多功能修改器V1.0.0 / Kingdom tow Crowns Trainer(千月修改器)

热门文章

  1. 组合查询(机房重构知识点总结)
  2. 安卓初学者必看实例,(手机GPS简单编程访问)
  3. mysqldump 常用备份选项,只备份数据或结构的方法
  4. 如何访问ASP.Net网站bin目录内的文件
  5. 学习Linux课程第十二天
  6. Spring Boot(一)—— Spring Boot 入门
  7. Linux 下C++编写
  8. CORBA GIOP消息格式学习
  9. html的!DOCTYPE标签初窥
  10. C# MongoDB简单增删改查使用