centos ntp clock synchronization

The note is mainly used for recording ntp server address or simple to use.
Many times after we installed the system, you do not pay attention to see if the machine will find the time and the actual time will vary, especially when online or experiments will be inconsistent because of time zone can not be completed. So here simply recording it.

1. Install the ntp service
yum install ntp -y ### installation services
systemctl start ntpd ##### to start the service
systemctl enable ntpd ##### boot

2. shagnhai region is set i.e. the time CST
ln -sf / usr / share / zoneinfo / Asia / Shanghai / etc / localtime

Configuration ntp clock synchronization
ntpdate asia.pool.ntp.org

Ali cloud
ntp1.aliyun.com
ntp2.aliyun.com
ntp3.aliyun.com
ntp4.aliyun.com
ntp5.aliyun.com
ntp6.aliyun.com
ntp7.aliyun.com

: On a Windows system comes with both a
time.windows.com and time.nist.gov
comes on both a Mac OS X:
time.apple.com and time.asia.apple.com
China National Time Service Center NTP server address is:
ntp.ntsc.ac.cn

The clock synchronization server addresses collected from the Internet should be enough.

  1. The system time to write hardware time
    hwclock --systohc

5. Configure boot check
Vim /etc/rc.d/rc.local
/ usr / sbin / ntp1.aliyun.com the ntpdate> / dev / null 2> &. 1; / sbin / hwclock -w

6. The timing of the configuration task
#crontab -e
# 0 /. 8 the ntpdate ntp1.aliyun.com> / dev / null 2> &. 1; / sbin / hwclock -w

Guess you like

Origin blog.51cto.com/907832555/2429742