服务器列表
192.168.0.2 ntp服务端
192.168.0.3 ntp客户端
192.168.0.4 ntp客户端
192.168.0.5 ntp客户端

注:以下操作均以root操作

一、NTP服务端

1.设置系统时间并写入硬件时钟,确保重启后时间不会改变。

设置系统时间
date -s "2017-07-21 10:20:00" 时间写入硬件
hwclock -w

2.设置NTP服务端作为时钟同步源

vi /etc/ntp.conf

#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

3.设置授权客户端

vi /etc/ntp.conf
restrict 192.168.0.3 mask 255.255.255.0 nomodify notrap
restrict 192.168.0.4 mask 255.255.255.0 nomodify notrap
restrict 192.168.0.4 mask 255.255.255.0 nomodify notrap

4.启动NTP服务并设置开机自动启动

/etc/init.d/ntpd restart
chkconfig --level 0123456 ntpd on

二、NTP客户端

1.配置NTP服务端

vi /etc/ntp.conf
server 192.168.0.2

2.手动同步时钟

先停止NTP服务
/etc/init.d/ntpd stop
手动同步时钟
ntpdate 192.168.0.2

3.启动NTP服务并设置开启自动启动

/etc/init.d/ntpd restart
chkconfig --level 0123456 ntpd on

4.查看NTP同步状态

watch ntpq -p

[原]NTP时钟同步服务设置的更多相关文章

  1. 配置ntpd时钟同步服务

    ntpd时钟同步服务 目录 参考: CentOS配置时间同步NTP: http://www.crsay.com/wiki/wiki.php/server/centos/ntp-set 解决ntp的错误 ...

  2. NTP时钟同步配置

    NTP在Linux下有两种时钟同步方式: 直接同步(也称跳跃同步)和平滑同步(也称微调同步). 直接同步 使用ntpdate命令进行同步,直接进行时间变更. 如果服务器上存在一个12点运行的任务,当前 ...

  3. Linux下的ntp时钟同步问题

    前段时间,项目中有个需求,需要将linux和windows的时间进行同步,网上也有很多类似时钟同步的帖子,大致类似:不过本次的linux的机器有点特殊,没有service命令,而且要求在另一台suse ...

  4. PTP时钟和NTP时钟同步有什么区别

    PTP时钟 理论上任何PTP时钟都能实现主时钟和从时钟的功能,但一个PTP通信子网内只能有一个主时钟.整个系统中的最优时钟为最高级时钟GMC(Grandmaster Clock),有着最好的稳定性.精 ...

  5. ntp 时钟同步

    注意: 如果你无法和外部网络的时钟同步,请检查UDP端口时候被封.

  6. NTP时钟同步学习记录

    --1 要点回顾 . 1. NTP唯一配置文件:/etc/ntp.conf . 2. NTP系统日志记录:/var/log/ntp . 3. ntp.conf简要介绍 - 利用 restrict 来管 ...

  7. Windows 2008 R2 NTP 时钟同步配置

    一.配置 本地组策略 a.windows+R 或  "开始菜单"  | "运行"  ,打开运行窗口. 输入gpedit.msc打开本地组策略 b.在 本地组策略 ...

  8. ntp时钟同步

    服务器时间的一致性,很关键的. 11. 基于ntp服务的形式 [root@server0 ~]# yum -y install chrony   //NTP客户端    centos7.x  cent ...

  9. 安装和配置CentOS时钟同步服务

    Type the following command to install ntp: # yum install -y ntp Turn on service: # chkconfig ntpd on ...

随机推荐

  1. python 让异常名称显示出来

    一 try: pass except Exception as e: print(e) 二 import sys try: pass except: print(sys.exc_info()) 下面有 ...

  2. 题解 P1453 【城市环路】

    P1453 城市环路 感觉基环树(or环套树)的题目一般都是找到树上的环,断掉一条边再进行树上的操作(如noip2018P5022 旅行) 双倍经验:P2607 [ZJOI2008]骑士 P1453和 ...

  3. 两台linux之间传输文件

    scp传输 当两台LINUX主机之间要互传文件时可使用SCP命令来实现 scp传输速度较慢,但使用ssh通道保证了传输的安全性 复制文件 将本地文件拷贝到远程 scp local_file remot ...

  4. Codeforces Round #599 (Div. 2) B1. Character Swap (Easy Version)

    This problem is different from the hard version. In this version Ujan makes exactly one exchange. Yo ...

  5. 前端——语言——Core JS——《The good part》读书笔记——初篇

    本书是一本经典,优秀的JS书籍. 目的 在书籍中作者多次提及本书的目的,让读者去发现语言中的精华部分,避免糟粕部分,提高代码的编写质量.简述为取其精华去其糟粕. 本书的内容只涉及到Core JS部分, ...

  6. C语言字符串类型转换为double浮点数类型

    #include <stdio.h>#include <stdlib.h>char *record; double re = atof(record); 使用 atof()函数 ...

  7. 树莓派3B 安装gcc和g++

    转:https://blog.csdn.net/zhuming3834/article/details/81946707 安装 如果不是root 用户,请自行加上sudo apt-get instal ...

  8. 《实战Java高并发程序设计》读书笔记三

    第三章 JDK并发包 1.同步控制 重入锁:重入锁使用java.util.concurrent.locks.ReentrantLock类来实现,这种锁可以反复使用所以叫重入锁. 重入锁和synchro ...

  9. 吴裕雄 python 神经网络——TensorFlow图片预处理调整图片

    import numpy as np import tensorflow as tf import matplotlib.pyplot as plt def distort_color(image, ...

  10. 微信js sdk分享开发摘记java版

    绑定域名和引入js的就不说了 废话不说直接上代码 public void share(HttpServletRequest request) throws Exception { StringBuff ...