系统:centos7
防火墙:关闭防火墙和selinux
软件:chrony

centos6我们一直用的ntp时间服务器,虽然到CentOS7上也可以装ntp。但是各种问题。所以建议centos7使用chrony同步工具。

服务端配置:

1.安装chrony软件
[root@server ~]# yum install chrony -y
2.修改配置文件
[root@server ~]# vim /etc/chrony.conf

server 0.centos.pool.ntp.org iburst     #可以修改ntp的服务器。最好用国内的。
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst allow 172.19.150.0/24 #打开允许同步的IP

阿里ntp的服务器列表

time1.aliyun.com
time2.aliyun.com
time3.aliyun.com
time4.aliyun.com
time5.aliyun.com
time6.aliyun.com
time7.aliyun.com

3.启动、开机自启动、查看状态、查看同步源
[root@server ~]# systemctl start chronyd

[root@server ~]# systemctl enable chronyd

[root@server ~]# systemctl status chronyd
● chronyd.service - NTP client/server
Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)
Active: active (running) since 一 2018-04-23 11:25:38 CST; 6min ago [root@server ~]# chronyc sources
210 Number of sources = 1
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* time4.aliyun.com 2 6 17 41 +87us[+1374us] +/- 28ms

客户端配置:

1. 安装chrony
[root@client ~]# yum install chrony -y
2. 修改配置文件
[root@client ~]# vim /etc/chrony.conf 

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
#server 0.centos.pool.ntp.org iburst #注释此处
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server 172.19.150.105 iburst #添加server
3.启动、开机自启动、查看状态、查看同步源
[root@client ~]# date
Sat Sep 9 00:00:02 CST 2017 [root@client ~]# systemctl start chronyd [root@client ~]# systemctl enable chronyd [root@client ~]# systemctl status chronyd
● chronyd.service - NTP client/server
Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2017-09-09 00:00:11 CST; 7 months 13 days ago
Docs: man:chronyd(8) [root@client ~]# date
Sat Sep 9 00:00:13 CST 2017 [root@client ~]# chronyc sources
210 Number of sources = 1
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* 172.19.150.105 3 6 17 3 +52us[ +107us] +/- 32ms
###最后一条有*号表示同步成功

CentOS7搭建时间服务器-chrony的更多相关文章

  1. CentOS7搭建时间服务器-chrony(不坑)

    标签(linux): chrony 笔者Q:972581034 交流群:605799367.有任何疑问可与笔者或加群交流 之前centos6我们一直用的ntp时间服务器,虽然到CentOS7上也可以装 ...

  2. CentOS 7.X 搭建时间服务器 --- chrony

    之前centos6我们一直用的ntp时间服务器,虽然到CentOS7上也可以装ntp.但是各种坑啊.这次换一个时间同步工具---->chrony ======================== ...

  3. centos7搭建时间服务器

    时区概念 GMT.UTC.CST.DST UTC:整个地球分为二十四个时区,每个时区都有自己的本地时间,在国际无线电通信场合,为了统一起见,使用一个统一的时间,称为通用协调时间(UTC:Univers ...

  4. CentOS7 搭建 SVN 服务器

    CentOS7 搭建 SVN 服务器 介绍SVN: SVN是Subversion的简称,是一个开放源代码的版本控制系统,相较于RCS.CVS,它采用了分支管理系统,它的设计目标就是取代CVS.互联网上 ...

  5. centos7 搭建WEB服务器

    centos7 搭建WEB服务器 2017年09月17日 09:44:50 逝然1994 阅读数:18321 标签: centosapacheweb服务器 更多 个人分类: centos服务器简单配置 ...

  6. Centos7 Ntp 时间服务器

    Centos7 Ntp 时间服务器 安装环境 [root@m02 ~]# cat /etc/redhat-release CentOS Linux release 7.4.1708 (Core) 安装 ...

  7. centos7搭建svn服务器及客户端设置

    centos7搭建svn服务器及客户端设置 centos7貌似预装了svn服务(有待确认),因此我们直接启动该服务即可 一.svn服务端配置(服务器IP假设为192.168.100.1) 步骤1:创建 ...

  8. CentOS7搭建NTP服务器及客户端同步时间

    一.服务器配置 1.查看服务器.客户端操作系统版本 [root@hadoop101 ~]# cat /etc/redhat-release CentOS Linux release (Core) 2. ...

  9. centos7 搭建DHCP服务器

    一.DHCP简单讲解 DHCP就是动态主机配置协议(Dynamic Host Configuration Protocol)是一种基于UDP协议且仅限用于局域网的网络协议,它的目的就是为了减轻TCP/ ...

随机推荐

  1. 使用Visual Studio快速开发STM32F4-Discovery探索板入门

    本本将主要介绍如何使用Visual Studio创建一个基于STM32F4-Discovery探索板的简单工程. 本文使用以下硬件和软件: ●      Microsoft Visual Studio ...

  2. k8s安装之prometheus.yaml

    这个系列的东东满多的.要另开系列说明. 这里为了内容连续完成,先贴一个吧,其它configmap,exporter就不展示. 为了保持统一,将prometheus也放到二级目录了. - '--web. ...

  3. 使用globalData函数设置全局变量

    在app.js中设置需要的全局变量的参数,比如公司名称等 //app.js App({ globalData: { title: 'tomatocc' } }) 然后就可以在某个页面的js文件中(比如 ...

  4. Mac下安装SQLmap的安装

    1.cd /usr/bin/ 2.sudo git clone https://github.com/sqlmapproject/sqlmap.git sqlmap-dev3.重新打开terminal ...

  5. Yum 安装memcached 与缓存清空

    1.安装 root@pts/0 # yum -y install memcached 2.启动服务         root@pts/0 # /etc/init.d/memcached start 3 ...

  6. Django源码分析rest_framework 关于re_path('^publish/', views.PublishView.as_view()总结

    1. ApiView 定义一个cbc视图 class BookView (APIView):pass re_path(r"books/$", views.BookView.as_v ...

  7. c# 异步方法中HttpContext.Current为空

    调用异步方法前 HttpContext context = System.Web.HttpContext.Current; HttpRuntime.Cache.Insert("context ...

  8. 使用 HttpClient 进行 Post 方式通信

    1.TestPost.java package testhttpclient; import java.io.IOException;import java.util.ArrayList;import ...

  9. asp.net+ tinymce粘贴word

    公司做的项目需要用到粘贴Word功能.就是将word内容一键粘贴到网页编辑器(在线富文本编辑器)中.Chrome+IE默认支持粘贴剪切板中的图片,但是我要粘贴的文章存在word里面,图片多达数十张,我 ...

  10. asp.net+ueditor word粘贴上传

    最近公司做项目需要实现一个功能,在网页富文本编辑器中实现粘贴Word图文的功能. 我们在网站中使用的Web编辑器比较多,都是根据用户需求来选择的.目前还没有固定哪一个编辑器 有时候用的是UEditor ...