首页 > 其他 > 详细

SUSE下搭建NTP时间同步服务器

时间:2017-03-31 22:25:13      阅读:344      评论:0      收藏:0      [点我收藏+]

linux:~ # cat /etc/ntp.conf | grep -v "^#"

server 127.127.1.0          # local clock (LCL)
fudge  127.127.1.0 stratum 10     # LCL is unsynchronized

restrict default nomodify

server 127.127.1.0

server 127.127.1.0 prefer

driftfile /var/lib/ntp/drift/ntp.drift # path for drift file

logfile   /var/log/ntp          # alternate log file

keys /etc/ntp.keys          # path for keys file

trustedkey 1               # define trusted keys
requestkey 1               # key (7) for accessing server variables

我们可以使用 ntpq 命令来检查本地服务器的时钟如何通过 NTP 同步。

ntpq -p  验证NTP服务器

linux:~ # ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
LOCAL(0)        .LOCL.          10 l   55   64  377    0.000    0.000   0.001
LOCAL(0)        .LOCL.           5 l   51   64  377    0.000    0.000   0.001
*LOCAL(0)        .LOCL.           5 l   62   64  377    0.000    0.000   0.001
linux:~ #

客户端同步服务器端的时间命令:

redhat系统,

 /usr/sbin/ntpdate 192.168.0.80

suse系统:

Callshine:~ # /usr/sbin/sntp 192.168.0.80

可以配置后台任务每5分钟同步一次,

*/5 * * * * /usr/sbin/sntp 192.168.0.80

5,10,15,20,25,30,35,40,45,50,55,0 * * * *  /usr/sbin/sntp 192.168.0.80

SUSE下搭建NTP时间同步服务器

原文:http://luosea.blog.51cto.com/8476080/1912130

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