如何让centos的时间与网络时间服务器同步

安装ntp服务 

sudo yum install ntp

sudo systemctl enable ntpd

修改NTP配置

vi /etc/ntp.conf

将时间服务器换成国内的

server 0.cn.pool.ntp.org
server 1.cn.pool.ntp.org
server 2.cn.pool.ntp.org
server 3.cn.pool.ntp.org

重启NTP服务

sudo systemctl restart ntpd

检查时间是否同步

ntpq -p

如果正常的话会显示类似如下  

 查看当前时间

date

常用故障排除参考

解决ntp的错误 no server suitable for synchronization found_enjoy java,enjoy life-CSDN博客以下从我在2008年7月10日在http://www.blogjava.net/spray 里写的迁移过来。 当用ntpdate -d 来查询时会发现导致 no server suitable for synchronization found 的错误的信息有以下2个:  错误1.Server dropped: Strata too high在ntp客户端运行ntpdate serhttps://blog.csdn.net/weidan1121/article/details/3953021

参考

How to Sync Your Linux Server Time with Network Time Servers (NTP)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值