NTP is used to synchronize the time on your Linux system with a centralized NTP server.
You can Install NTP Service using
$ sudo yum install ntp
or
$ sudo apt-get install ntpd
To Configure NTP with External server
$ sudo ntpdate pool.ntp.org
31 Aug 19:07:11 ntpdate[10355]: adjust time server 46.29.176.115 offset -0.002893 sec
but sometimes you might receives errors if ntp daemon already up and running.
$ sudo ntpdate pool.ntp.org
31 Aug 19:05:55 ntpdate[8911]: the NTP socket is in use, exiting
to resolve this you need to restart NTP service & run the above commands.
$ sudo service ntpd stop
[ ok ] Stopping NTP server: ntpd.
$ sudo ntpdate pool.ntp.org
31 Aug 19:07:11 ntpdate[10355]: adjust time server 46.29.176.115 offset -0.002893 sec
$ sudo service ntpd start
or
$ sudo ntpdate -u pool.ntp.org
You can check the status of NTP using the ntpq command.
# sudo ntpq -p
Remote refid st t when poll reach delay offset jitter
=======================================================
*120.88.46.10 193.67.79.202 2 u 344 512 377 6.870 -7.724 2.512
If you get any connection refused errors then the time server is not responding or the NTP daemon/port is not started or listening.
You can also use the following command to get the current status of ntpd.
# sudo ntpdc -c sysinfo
system peer: 120.88.46.10
system peer mode: client
leap indicator: 00
stratum: 3
precision: -20
root distance: 0.13884 s
root dispersion: 0.13063 s
reference ID: [120.88.46.10]
reference time: d9c9d081.04ed3601 Thu, Oct 15 2015 12:43:05.019
system flags: auth monitor ntp kernel stats
jitter: 0.013794 s
stability: 0.000 ppm
broadcastdelay: 0.003998 s
authdelay: 0.000000 s
Make sure the service starts at boot:
$ sudo chkconfig ntpd on
Note.
NTP servers communicate over port 123 UDP and unlike most UDP protocols the source port is NOT a high port, but uses 123 as well. The firewall must be configured to allow UDP on both source and destination ports 123 for your servers.
You can Install NTP Service using
$ sudo yum install ntp
or
$ sudo apt-get install ntpd
To Configure NTP with External server
$ sudo ntpdate pool.ntp.org
31 Aug 19:07:11 ntpdate[10355]: adjust time server 46.29.176.115 offset -0.002893 sec
but sometimes you might receives errors if ntp daemon already up and running.
$ sudo ntpdate pool.ntp.org
31 Aug 19:05:55 ntpdate[8911]: the NTP socket is in use, exiting
to resolve this you need to restart NTP service & run the above commands.
$ sudo service ntpd stop
[ ok ] Stopping NTP server: ntpd.
$ sudo ntpdate pool.ntp.org
31 Aug 19:07:11 ntpdate[10355]: adjust time server 46.29.176.115 offset -0.002893 sec
$ sudo service ntpd start
or
$ sudo ntpdate -u pool.ntp.org
You can check the status of NTP using the ntpq command.
# sudo ntpq -p
Remote refid st t when poll reach delay offset jitter
=======================================================
*120.88.46.10 193.67.79.202 2 u 344 512 377 6.870 -7.724 2.512
If you get any connection refused errors then the time server is not responding or the NTP daemon/port is not started or listening.
You can also use the following command to get the current status of ntpd.
# sudo ntpdc -c sysinfo
system peer: 120.88.46.10
system peer mode: client
leap indicator: 00
stratum: 3
precision: -20
root distance: 0.13884 s
root dispersion: 0.13063 s
reference ID: [120.88.46.10]
reference time: d9c9d081.04ed3601 Thu, Oct 15 2015 12:43:05.019
system flags: auth monitor ntp kernel stats
jitter: 0.013794 s
stability: 0.000 ppm
broadcastdelay: 0.003998 s
authdelay: 0.000000 s
Make sure the service starts at boot:
$ sudo chkconfig ntpd on
Note.
NTP servers communicate over port 123 UDP and unlike most UDP protocols the source port is NOT a high port, but uses 123 as well. The firewall must be configured to allow UDP on both source and destination ports 123 for your servers.
Latest Govt Jobs 2016
ReplyDeleteDSE Punjab ETT Teacher Notification 2015-16
A big thank you for your post.Really looking forward to read more, Very much impressed