频道栏目
首页 > 资讯 > Linux > 正文

Chrony时间服务器-daniel_linux的博客-51CTO博客

19-05-06        来源:[db:作者]  
收藏   我要投稿

简介

chrony是网络时间协议(NTP)的通用实现,chrony中包含两个程序,chronyd是一个可以在启动时启动的守护程序,chronyc是一个命令行界面程序。

配置文件:chrony.conf
server:时间服务器地址;
allow :允许客户端;
deny :拒绝客户端;;
local stratum 10:即使自己未能同步网络时间,也允许授时给其它客户端;

环境

CentOS Linux release 7.6
server: 10.120.123.8
client : 10.120.123.9

安装Chrony

yum install -y chrony

server端(10.120.123.8)

配置文件

vim/etc/chrony.conf
allow 10.120.123.0/24

启动服务

systemctl start chronyd.service
systemctl enable chronyd.service  

查看端口

netstat -nlup | grep chronyd 
udp        0      0 0.0.0.0:123             0.0.0.0:*                           9091/chronyd        
udp        0      0 127.0.0.1:323         0.0.0.0:*                           9091/chronyd        
udp6      0      0 ::1:323                     :::*                                   9091/chronyd     

client端(10.120.123.9)

配置文件

vim/etc/chrony.conf
server 10.120.123.8 iburst
#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

启动服务

systemctl start chronyd.service
systemctl enable chronyd.service  

查看同步状态

1,chronyc sourcestats
210 Number of sources = 1
Name/IP Address            NP  NR  Span  Frequency  Freq Skew  Offset  Std Dev
==============================================================================
10.120.123.8                0   0     0     +0.000   2000.000     +0ns  4000ms
2.chronyc sources -v
210 Number of sources = 1

  .-- Source mode  '^' = server, '=' = peer, '#' = local clock.
 / .- Source state '*' = current synced, '+' = combined , '-' = not combined,
| /   '?' = unreachable, 'x' = time may be in error, '~' = time too variable.
||                                                 .- xxxx [ yyyy ] +/- zzzz
||      Reachability register (octal) -.           |  xxxx = adjusted offset,
||      Log2(Polling interval) --.      |          |  yyyy = measured offset,
||                                \     |          |  zzzz = estimated error.
||                                 |    |           \
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
相关TAG标签
上一篇:山特后备式UPS电源K500PRO-东方阳光UPS的博客-51CTO博客
下一篇:加密类型及其算法-TomJames的博客-51CTO博客
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站