工作笔记 — NTP (Linux上的时间同步服务。

NTP是一个同步世界时间的标准。

电脑由于某些设计上的天生缺陷,在长时间运作后,它的时间都会慢慢的不准。而通过NTP就可以让它自动调整。这个功能在服务器上尤其重要。

在Linux系统上,NTP自动调整可以通过ntpd这个小程序达成。

指令:service ntpd status
用于检查ntpd是否有在运作。

指令:ntpdate my.ntp.server.url1 my.ntp.server.url2 …
用于手动同步时间。如果ntpd正在运作,这个指令将返回『the NTP socket is in use, exiting』错误讯息。
ntp server可以用time.windows.com或time.apple.com。或者一些公开的NTP Free Server都可以。

指令:date
检查目前系统的日期和时间。

——————-

问题解决:
如果面对在手动更新时发现以下问题时。。。

[root@web54 root]# ntpdate ca.pool.ntp.org
7 Jan 00:44:33 ntpdate[28185]: sendto(216.234.161.11): Operation not permitted
7 Jan 00:44:34 ntpdate[28185]: sendto(216.234.161.11): Operation not permitted
7 Jan 00:44:35 ntpdate[28185]: sendto(216.234.161.11): Operation not permitted
7 Jan 00:44:36 ntpdate[28185]: sendto(216.234.161.11): Operation not permitted
7 Jan 00:44:37 ntpdate[28185]: no server suitable for synchronization found

请检查你的防火墙是否已经打开了Port 123。

One Reply to “工作笔记 — NTP (Linux上的时间同步服务。”

Comments are closed.