First, the installation of NTP II, synchronization time three, the system time to write to the system hardware, to avoid restarting the server time coverage of four, set Schedule task synchronization network time issues Appendix I, Installation NTP
[Root@server-2 ~]# Yum install-y ntpdate
second, synchronization time
Way one, use domain name connection, want to go through DNS resolution, slow speed.
[root@server-2 ~]# ntpdate pool.ntp.org
/Mode Two, use IP connection, super fast.
[root@server-2 ~]# ntpdate 120.24.81.91
http://www.pool.ntp.org is the official website of NTP, where we can find the NTP server from our country. Cn.pool.ntp.org. It has 3 server addresses:
server one: 1.cn.pool.ntp.org
Server two: 2.asia.pool.ntp.org
Server three: 3.asia.pool.ntp.org
(There are sometimes problems with the domain name, you can ping their IP first, and then sync with the IP address)
//The following information shows the success of the
5 Feb 21:23:06 ntpdate[62910 ]: Step Time Server 182.92.12.11 offset-40.589470 sec
third, the system time to write to the system hardware, to avoid restarting the server time coverage
Display Hardwareclock System hardware time
[root@server-2 ~]# hwclock
//write system time to system hardware
[root@server-2 ~]# hwclock-w
Set Schedule Task synchronization network time
The crontab format is as follows: # For details look man
4 crontabs
# Example of job definition:
#.----------------Minute (0-59)
# | . -------------Hour (0-23)
# | | ----------Day of Month (1-31)
# | | | . -------Month (1-12) OR jan,feb,mar,apr ...
# | | | | . ----Day of Week (0-6) (sunday=0 or 7) or Sun,mon,tue,wed,thu,fri,sat
#
| | | * * * * * * command to be executed
set crontab scheduled tasks in two ways:
1, written in the/etc/crontab
Code: * * * * * *
root ntpdate 210.72.145.44
11 daily sync time with China National Service Center at
11 times a
day sync time with China National Timing center of course, if Apt-get Install ntpdate Code * * *
root ntpdate us.pool.ntp.org
2, use command crontab-e
crontab-e
10 5 * * * * * * Root ntpdate us.pool.ntp.org;hwclock-w The
time when the network is automatically 5:10 every day, and the BIOS is updated simultaneously
######################## ########
problem
Appendix