Re-synchronize Linux to NTP server

点点圈 提交于 2019-12-11 17:12:35

问题


We're planning to re-synchronize 2 of our machines that's having a 19ms delay from the NTP server (this involves SMS transaction). Those servers are having discrepancy with analytics results and we're suspecting it's one of the cause.

So my question is, is it service affecting to re-sync the server to the NTP server? Thanks in advance! Have a great day!


回答1:


If NTP is not already installed, use the following command to install:

// Ubuntu or other Debian-based system
sudo apt-get install ntp
// CentOS, Fedora or other RedHat-based system
yum install ntp

Then, config the settings:

vi /etc/ntp.conf

Find the server lines, and edit the server addresses to fit your needs:

server 0.north-america.pool.ntp.org
server 1.north-america.pool.ntp.org
server 2.north-america.pool.ntp.org
server 3.north-america.pool.ntp.org

Restart the service to apply changes:

/etc/init.d/ntpd restart

Use the following commands to sync the time with NTP server in Linux just once:

/etc/init.d/ntpd stop
/usr/sbin/ntpdate pool.ntp.org
/etc/init.d/ntpd start



回答2:


Is it service affecting especially when the servers and other networking equipment are in production or live traffic

No. But I'd re-examine my NTP setup to see why the clocks drifted. By chance, are these virtual machines? If so, differing types of virtual machines can be slaved to the physical server clock, or can run NTP themselves.

But it's hard to see why a 19ms discrepancy is significant.



来源:https://stackoverflow.com/questions/29786396/re-synchronize-linux-to-ntp-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!