我爱汽车网

时间服务器地址 ntp时间服务器地址

Linux服务器运行久时,系统时间就会存在一定的误差,一般情况下可以使用date命令进行时间设置,但在做数据库集群分片等操作时对多台机器的时间差是有要求的,此时就需要使用ntpdate进行时间同步

安装:

yum install ntpdate

ntpdate简单用法:

# ntpdate ip

# ntpdate 210.72.145.44

date命令:

date :查看当前时间,结果如下:Tue Mar 4 01:36:45 CST 2014

date -s 09:38:40 :设置当前时间,结果如下:Tue Mar 4 09:38:40 CST 2014

ntpdate命令:

ntpdate -u 210.72.145.44 :网络时间同步命令

注意:若不加上-u参数, 会出现以下提示:no serversuitable for synchronization found

-u:从man ntpdate中可以看出-u参数可以越过防火墙与主机同步;

210.72.145.44:中国国家授时中心的官方服务器。

ntp常用服务器:

中国国家授时中心:210.72.145.44

NTP服务器(上海) :m.52car.net

美国:m.52car.net

复旦:m.52car.net

微软公司授时主机(美国) :m.52car.net

台警大授时中心(台湾):m.52car.net

测试中国国家授时中心与NTP上海服务器可以正常同步时间,注意需要加上-u参数!

以下是一些可用的NTP服务器地址: