NTP stands for Network Transfer Protocol, this protocol developed to synchronize the clocks of system over the network. The NTP set that the true time to operate and internet standard protocol. There are several reference clocks synchronize over a network and exchange the time information either bidirectional or unidirectional.
You can install the NTP by YUM command on terminal, just run the below command,
# yum install ntp
Dependencies Resolved
=============================================================================================
Package Arch Version Repository Size
=============================================================================================
Installing:
ntp x86_64 4.2.6p5-5.el6.centos base 595 k
Installing for dependencies:
ntpdate x86_64 4.2.6p5-5.el6.centos base 77 k
Transaction Summary
=============================================================================================
Install 2 Package(s)
Total download size: 672 k
Installed size: 1.7 M
Is this ok [y/N]: y
The ntp default installation directory is /usr/sbin/. Once the installation completed can check the installed path.
You can Start, Stop, Status ntpd service using below commands,
# /etc/init.d/ntpd start
Starting ntpd: [ OK ]
# /etc/init.d/ntpd status
ntpd (pid 20568) is running...
# /etc/init.d/ntpd stop
Shutting down ntpd: [ OK ]
Also do you want to startup this service on system booting time, need to enable on chkconfig,
# chkconfig ntpd on
# chkconfig --list ntpd
# chkconfig --list ntpd
ntpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
After NTP service has been started, the time will be synchronize with its pool servers, so you need to wait for few moments then run the following commands.
# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
+clock.sjc.he.ne .CDMA. 1 u 3 64 1 239.612 38.680 1.174
*ntp.your.org .CDMA. 1 u 2 64 1 229.875 29.049 0.594
-resolver2.level 10.67.8.18 3 u 1 64 1 132.664 23.690 0.759
+services.quadra 96.44.142.5 3 u 1 64 1 222.392 30.848 0.790
# date -R
Fri, 09 Oct 2015 18:49:11 +0530
# ntpdate -q 0.ro.pool.ntp.org 1.ro.pool.ntp.org
server 78.96.7.8, stratum 2, offset -0.018490, delay 0.18530
server 82.77.139.162, stratum 3, offset -0.012878, delay 0.20699
server 82.78.227.6, stratum 2, offset -0.014045, delay 0.20486
server 89.149.54.30, stratum 2, offset -0.012620, delay 0.22261
server 89.149.59.102, stratum 2, offset -0.011485, delay 0.21278
server 93.190.144.3, stratum 2, offset -0.014490, delay 0.19954
server 89.149.54.18, stratum 2, offset -0.017279, delay 0.21910
server 89.40.65.2, stratum 2, offset -0.012900, delay 0.21053
9 Oct 18:49:36 ntpdate[20662]: adjust time server 78.96.7.8 offset -0.018490 sec
Need more log information about access and troubleshooting when running the service, just create a ntp.log file and configure in ntp.conf file.
Open a ntp.conf file in any text editor and add the below line,
# vim /etc/ntp.conf
logfile /var/log/ntp.log
After update, you want to restart the service.
Comments (0)