linux上同步时间

我使用的是NTP服务来同步时间。

1.安装NTP

yum install ntp
2.执行命令行

ntpdate -u ntp.api.bz

这条命令语句的意思是:将本地服务器的时间和ntp.api.bz上的时间同步;其中ntp.api.bz是NTP在上海服务器。

也可以同步到其它服务器,http://www.ntp.org.cn/

同步过程中可能会报错如下错误:

no server suitable for synchronization found

导致这个报错的原因可能是:你选择的同步服务器不正确,尝试更换同步服务器。

猜你喜欢

转载自blog.csdn.net/h996666/article/details/79093428