用处:利用接入层(web)连接互联网进行时间同步,服务器局域网连接局域网进行同步。

工具:chrony

服务chronyd(向外提供服务);chrony(进行时间同步)

一,1;安装工具chrony,

2;找到配置文件 /etc/chrony.conf

cat /etc/chrony.conf 
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server ntp1.aliyun.com iburst  #向谁进行时间同步
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
1server 3.centos.pool.ntp.org iburst

allow 0.0.0.0/0 #允许谁向我同步

设置时间同步服务器;各大厂商阿里,腾讯,百度。前提能ping同;allow允许谁向我同步

3;重启服务chrony

systemctl restart chronyd.service 

查看状态

^+ #表示可用时间服务器地址 
^*  #表示客户端正在连接同步时间的服务器地址 
^? #表示不可用的服务器地址

二,客户端;局域网配置

同样安装chrony;

打开配置文件/etc/chrony.conf

添加向外提供的服务器地址;

server 10.0.0.17 iburst 
重启服务

看状态,已经成功

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐