CentOS 6.2 设置时间
设置时区:
设置为东八区北京时间
cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
同步时间
yum install ntpdate -y
ntpdate time.nist.gov
定期同步时间的两种方式:
<1>添加同步时间到定时任务
crontab -e
00 */1 * * * ntpdate time.nist.gov
<2>开启ntpdate服务
chkconfig ntpdate on
echo \'time.nist.gov\' >> /etc/ntp/step-tickers
service ntpdate start
亚洲服务器地址:
服务器一: 1.cn.pool.ntp.org
服务器二: 2.asia.pool.ntp.org
服务器三: 3.asia.pool.ntp.org