美文网首页
【ntp】ntp安装配置

【ntp】ntp安装配置

作者: Bogon | 来源:发表于2023-04-28 00:43 被阅读0次

$ ansible -i hosts all -m shell -a 'sudo systemctl stop ntpd'

$ ansible -i hosts all -m shell -a 'sudo ntpdate -u 192.168.64.102'

$ cat /etc/ntp.conf

driftfile /var/lib/ntp/drift
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1 
restrict -6 ::1
server 192.168.64.102 iburst
server 192.168.41.225 iburst
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
SYNC_HWCLOCK=yes

$ ansible -i hosts all -m shell -a 'sudo systemctl restart ntpd'

$ ansible -i hosts all -m shell -a 'sudo ntpq -p'

10.19.70.155 | CHANGED | rc=0 >>
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*192.168.64.102   46.19.96.19      3 u   39   64    1    0.786   -0.182   0.041
 192.168.41.225   78.46.102.180    4 u   38   64    1    0.616   -7.454   0.103

10.19.70.159 | CHANGED | rc=0 >>
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*192.168.64.102   46.19.96.19      3 u    -   64    7    0.919   -1.810   0.117
 192.168.41.225   78.46.102.180    4 u    -   64    7    0.587   -8.864   0.227

10.19.70.154 | CHANGED | rc=0 >>
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*192.168.64.102   46.19.96.19      3 u   31   64    3    0.832   -1.751   0.177
 192.168.41.225   78.46.102.180    4 u   29   64    3    0.838   -8.861   0.307

10.19.70.158 | CHANGED | rc=0 >>
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*192.168.64.102   46.19.96.19      3 u   40   64    7    0.786    6.247   0.363
 192.168.41.225   78.46.102.180    4 u   38   64    7    0.791   -0.545   0.480

相关文章

网友评论

      本文标题:【ntp】ntp安装配置

      本文链接:https://www.haomeiwen.com/subject/urnujdtx.html