ntpdate命令:
ntpdate -u 210.72.145.44 :网络时间同步命令
我这边采用和集群中的某一台机器做时间同步
[root@had]# ntpdate -u had
May 3 03:20:23 ntpdate[4454]: step time server 192.168.18.160 offset 154.003952 sec
[root@had]# date
Thu May 3 03:20:23 CST 2018
注意:若不加上-u参数, 会出现以下提示:no server suitable for synchronization found
-u:从man ntpdate中可以看出-u参数可以越过防火墙与主机同步;
210.72.145.44:中国国家授时中心的官方服务器。
ntp常用服务器:
中国国家授时中心:210.72.145.44
NTP服务器(上海) :ntp.api.bz
美国:time.nist.gov
复旦:ntp.fudan.edu.cn
微软公司授时主机(美国) :time.windows.com
台警大授时中心(台湾):asia.pool.ntp.org
经测试中国国家授时中心与NTP上海服务器可以正常同步时间,注意需要加上-u参数!