我们使用阿里云的ntp时间服务器即可不需要自己搭建。
配置如下

yum install -y ntp  #安装客户端

vim /etc/ntp.conf

阿里云ntp地址打开确认
https://www.alibabacloud.com/help/zh/elastic-compute-service/latest/alibaba-cloud-ntp-server
其他的ntp配置时间服务器注释掉,

# server 0.centos.pool.ntp.org iburst
# xxxxxxxxxxxxxxxxxxx

添加内容如下

server ntp1.aliyun.com

启动客户端
centos 7

systemctl enable ntpd.service
systemctl start ntpd

centos6

service ntpd start

查看运行结果

watch ntpq -p

2022-12-21T06:29:39.png

Last modification:December 22, 2022
如果觉得我的文章对你有用,请随意赞赏