在Ubuntu服务器上,我通常的解决scheme就是安装ntp
软件包,然后每天给它打电话。 这将安装所需的所有二进制文件,并在启动时启动ntpd。
现在我正在开发一个服务器configuration,它将在许多服务器上进行复制,而且通常需要尽可能的精简。 我注意到在ntpd的默认configuration中,可以向服务器发出请求,询问它是什么时间。 我不需要这个。 我只需要服务器自己的时间来保持最新。
ntpdate作为cron作业不是上面所述的ntpd的替代品。
如果你在许多服务器上复制这个configuration,你为什么不把注释掉的ntpd.conf中的行注释掉,然后再重新打包,或者使用一些像puppet这样的configurationpipe理器将它推到所有的盒子上他们?
你可以试试OpenBSD的实现, OpenNTPD ; 虽然它被批评是因为没有完全实现NTP协议(也许有点欺骗它),但它可能比官方的ntpd更合适。
所以似乎没有办法得到所有ntpd没有ntpdfunction。 所以我只是通过对/etc/ntp.conf进行修改来运行它。 我还需要最后两行吗?
# Commenting out these lines that came standard # # By default, exchange time with everybody, but don't allow configuration. # restrict -4 default kod notrap nomodify nopeer noquery # restrict -6 default kod notrap nomodify nopeer noquery # Adding this one line restrict default ignore # Do I still need this? Does ntpd query itself when setting the local server's time? # Local users may interrogate the ntp server more closely. restrict 127.0.0.1 restrict ::1