Centos6 system time synchronization ntpdate
The newly installed linux system server may be set incorrectly. The cluster time is very important during cluster creation. It is very likely that cluster errors occur due to time. Therefore, you need to adjust the time zone and adjust the time.
As follows, the CentOS6 system uses NTP to synchronize time from a time server so that the time is synchronized at regular intervals.
Perform the following steps to synchronize time in CentOS6:
1. Some versions do not contain netdate, so you need to download
# Yum install-y ntpdate
2. Change the current time zone to Shanghai, that is, Beijing time + 8.
If you want to change other time zones, you can go to the/usr/share/zoneinfo directory.
# Yes | cp-f/usr/share/zoneinfo/Asia/Shanghai/etc/localtime
3. Use NTP to synchronize time
# Ntpdate us.pool.ntp.org
4. We have timed synchronization of time.
Add scheduled tasks and synchronize the clock every 10 minutes
# Crontab-l>/tmp/crontab. bak
# Echo "*/10 *****/usr/sbin/ntpdate us.pool.ntp.org | logger-t NTP">/tmp/crontab. bak
# Crontab/tmp/crontab. bak
In this way, we have solved the problem of inaccurate time.