大數據

CentOS自動同步互聯網服務器時間

由於大數據中,集群對時間要求很高,所以集群內主機要經常同步時間(包括時區的同步)。
常用的手動進行時間的同步

date -s "2017-03-03 03:03:03"

或者網絡同步:

yum install ntpdate
ntpdate cn.pool.ntp.org

還可以進行如下的設置:
1、yum install ntp
2、vi /etc/ntp.conf

修改如下部分:
server 58.220.207.226 iburst
server 47.92.108.218 iburst
server 202.112.29.82 iburst
server 202.108.6.95 iburst
其中ip為全球可用的ntp時間服務器,免費提供授時服務。

3、配置之後,保存設置,重啟服務

service ntpd stop
service ntpd start

4、甚至可以設置crontab來定時與互聯網服務器進行同步

Leave a Reply

Your email address will not be published. Required fields are marked *