ntp时间同步配置

2019-03-10  本文已影响0人  JaySon_h

安装 ntp

yum install ntp -y
systemctl stop ntpd  # 先停止ntpd服务
/usr/sbin/ntpdate 10.xx.xx.xx 100.xx.xx.xx  # 手动同步时间

修改ntp配置文件

vi /etc/ntp.conf 添加内网ntp服务器。

image.png

systemctl start ntpd 启动ntpd服务

ntp同步状态查看

1. ntpstat

ntpstat 命令查看时间同步状态,这个一般需要5-10分钟后才能成功连接和同步。所以,服务器启动后需要稍等下。
刚启动的时候,一般是:

# ntpstat
unsynchronised
  time server re-starting
   polling server every 8 s

连接并同步后

# ntpstat
synchronised to NTP server (100.115.8.147) at stratum 4
   time correct to within 1230 ms
   polling server every 64 s

2. ntpq -p

# ntpq -p
   remote           refid      st t when poll reach   delay   offset  jitter
============================================================================
*10.xx.xx.xx  10.175.113.138   3 u   44  128  377    1.065   -0.469   0.087
+100.xx.xx.xx   10.175.113.138   3 u  112  128  377    3.218   -0.986   0.372

*表示目前使用的ntp server;
st:即stratum阶层,值越小表示ntp serve的精准度越高;
when:几秒前曾做过时间同步更新的操作;
Poll表示,每隔多少毫秒与ntp server同步一次;
reach:已经向上层NTP服务器要求更新的次数;
delay:网络传输过程钟延迟的时间;
offset:时间补偿的结果;
jitter:Linux系统时间与BIOS硬件时间的差异时间

上一篇 下一篇

猜你喜欢

热点阅读