目录
-
16.1. ntpd - Network Time Protocol (NTP) daemon
-
16.2. ntp client
http://www.ntp.org
16.1. ntpd - Network Time Protocol (NTP) daemon
过程 16.1. ntp server
-
# yum install ntp
-
port
[root@ntp ~]# netstat -unlnp |grep 123
udp 0 0 192.168.5.5:123 0.0.0.0:* 10810/ntpd
udp 0 0 172.16.0.5:123 0.0.0.0:* 10810/ntpd
udp 0 0 192.168.3.5:123 0.0.0.0:* 10810/ntpd
udp 0 0 127.0.0.1:123 0.0.0.0:* 10810/ntpd
udp 0 0 0.0.0.0:123 0.0.0.0:* 10810/ntpd
udp 0 0 ::1:123 :::* 10810/ntpd
udp 0 0 fe80::225:64ff:fe9a:123 :::* 10810/ntpd
udp 0 0 :::123 :::* 10810/ntpd
[root@ntp ~]# lsof -i :123
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
ntpd 10810 ntp 16u IPv4 35921 UDP *:ntp
ntpd 10810 ntp 17u IPv6 35922 UDP *:ntp
ntpd 10810 ntp 18u IPv6 35923 UDP [fe80::225:64ff:fe9a:d7e0]:ntp
ntpd 10810 ntp 19u IPv6 35924 UDP localhost6.localdomain6:ntp
ntpd 10810 ntp 20u IPv4 35925 UDP localhost.localdomain:ntp
ntpd 10810 ntp 21u IPv4 35926 UDP nis.example.com:ntp
ntpd 10810 ntp 22u IPv4 35927 UDP 172.16.0.5:ntp
ntpd 10810 ntp 23u IPv4 35928 UDP 192.168.5.5:ntp
-
status
ntpstat
[root@subversion ~]# ntpstat
synchronised to local net at stratum 11
time correct to within 11 ms
polling server every 1024 s
[root@subversion ~]# ntptrace -n 127.0.0.1
127.0.0.1: stratum 11, offset 0.000000, synch distance 0.010984
[root@subversion ~]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
122.226.192.4 .INIT. 16 u - 1024 0 0.000 0.000 0.000
218.75.4.130 .INIT. 16 u - 1024 0 0.000 0.000 0.000
www.chinaepg.ne .INIT. 16 u - 1024 0 0.000 0.000 0.000
*LOCAL(0) .LOCL. 10 l 60 64 377 0.000 0.000 0.001
-
http://www.pool.ntp.org/
vim /etc/ntp.conf
server 2.cn.pool.ntp.org
server 3.asia.pool.ntp.org
server 2.asia.pool.ntp.org
-
# chkconfig ntpd on
# service ntpd start/stop/restart
Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a>comments powered by
原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。