The newly installed CentOS system server may have set the wrong time, time is very important when doing the cluster, it is likely that the cluster will fail because of the time, so you need to adjust the time zone and adjust the times. The following is a CentOS system that uses NTP to synchronize time from a time server to synchronize time at timed intervals.
Ntp:network time protocol, known as the Network Timing protocol, is the standard Internet Protocol for time synchronization in the Internet. The purpose of NTP is to synchronize the computer's time to a certain time standard. The time standard currently in use is UTC at World coordination Time (Universal-coordinated).
The CentOS system time synchronization steps are as follows:
1. Download Ntpdate
Note: Some versions are not self-ntpdate and therefore need to be downloaded
# yum Install-y ntpdate
2. Adjust the time zone toShanghai, +8 District, Beijing time
Note: You can also go to the/usr/share/zoneinfo directory if you want to change other time zones
# Cp/usr/share/zoneinfo/asia/shanghai/etc/localtime
# Yes | Cp-f/usr/share/zoneinfo/asia/shanghai/etc/localtime
3. Use NTP to synchronize time
# ntpdate us.pool.ntp.org
4, timing synchronization time (every 10 minutes synchronous clock)
# crontab-l >/tmp/crontab.bak
# echo "*/10 * * * * */usr/sbin/ntpdate us.pool.ntp.org | Logger-t NTP ">>/tmp/crontab.bak
# Crontab/tmp/crontab.bak
So we can solve the problem of time.
Centos/linux Automatically synchronize server time