First, the environment
[Email protected] tmp]# cat/etc/redhat-6.9-I10.0. 0.61 172.16. 1.61(intranet)
Second, check whether the service software is installed
[Email protected] tmp]# RPM-QA ntpntp-4.2. 6p5-. 2. x86_64
Third, modify the NTP configuration file
vim/etc/ntp.conf# Restrict default kod nomodify notrap nopeer noqueryRestrictdefaultnomodify# usePublic servers from the pool.ntp.org project.# Please consider joining the pool (http: www.pool.ntp.org/join.html). #server 0. centos.pool.ntp.org iburst#server 1. centos.pool.ntp.org iburst#server 2. centos.pool.ntp.org iburst#server 3 . centos.pool.ntp.org iburst# adds the original unavailable source comment, adding a new time synchronization source server Ntp1.aliyun.comserver time.nist.gov
Iv. Start the NTP service (this server requires an external network)
[Email protected] tmp]#/etc/init.d/ntpd startstarting ntpd: [ OK ]
Note:
Time is automatically updated after startup
If the original synchronization time task, close, otherwise will be reported as the next error.
Ntpdate[118978]: The NTP socket is on use, exiting
Five, no external network server synchronization time
172.16. 1.61 Ten £ º£ ntpdate[ 21609172.16. 1.610.000652 sec
#时间服务器启动后, it takes a few minutes for the synchronization to take place.
Ntpdate[5687]:for synchronization found
Six, the synchronous command into the scheduled task
[Email protected] ~]# crontab- -10-10*/5172.16. 1.61 >/dev/null2>&1
Linux operations, architecture-Intranet NTP time server