首页 > 其他 > 详细

[原]CentOS 7 chrony 笔记

时间:2018-08-26 23:16:43      阅读:241      评论:0      收藏:0      [点我收藏+]
~]# timedatectl  status
      Local time: Sun 2018-08-26 21:01:15 CST        ==> 本地系统实际时间,设置时间timedatectl set-time 15:58:30
                                                                           设置日期timedatectl set-time 20151120
                                                                           设置时间日期timedatectl set-time 16:10:40 2015-11-20
      Universal time: Sun 2018-08-26 13:01:15 UTC    ==> 世界统一时间
      RTC time: Sun 2018-08-26 13:01:15              ==> 硬件时钟的时间
      Time zone: Asia/Shanghai (CST, +0800)          ==> 当前时区,查看可用时区timedatectl list-timezones
                                                                   设置当前时区timedatectl set-timezone "Asia/Shanghai"
                                                                   设置世界统一时区timedatectl set-timezone UTC
      NTP enabled: yes                               ==> 开启自动同步时间服务器功能,timedatectl set-ntp true 或 timedatectl set-ntp false
      NTP synchronized: yes                          ==> 与时间服务器的同步状态,如果显示yes,则同步成功
      RTC in local TZ: no                            ==> 将时区设置为本地时区,timedatectl set-local-rtc 1
                                                         硬件时钟设置为协调世界时(UTC)timedatectl set-local-rtc 0
      DST active: n/a



[root@network ~]# 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               
===============================================================================
^? controller                    9   6    37    47   +123us[ +123us] +/-   25ms           ==>如果前面是有个?表明时间服务器不可达


[root@network ~]# 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               
===============================================================================
^* controller                    9   6   177    46    +19us[  -65us] +/-   36ms         ==>如果前面是有个*表明时间服务器可同步








常用的命令:
启动chronyd进程
systemctl start chronyd.service
强制单次进行时间同步  
chronyd -q server <时间服务器域名> iburst
或者
ntpdate <ntp_server_name>
## 查看 ntp服务器是否可以正常同步
ntpdate -d <ntp_server_name>
## 查看 ntp_servers 状态
chronyc sources -v
## 查看 ntp_sync 状态
chronyc sourcestats -v
## 查看 ntp_servers 是否在线
chronyc activity -v
## 查看 ntp 详细信息
chronyc tracking -v







当执行ntpdate -d <ntp_server_name>出现 NTP. Server dropped: strata too high  
可能原因是时间服务器stratum 值过高  调低就可以了  比如server为 8   client为9  则正常
当执行ntpdate -d <ntp_server_name>出现Server dropped: no data  
可能原因是没有reach到时间服务器的时间服务,没有获取到数据,需要重新获取一次或多次数据

 

[原]CentOS 7 chrony 笔记

原文:https://www.cnblogs.com/horizonli/p/9539436.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!