centos8内网环境下搭本地时间服务器

CentOS7时,使用的是ntpdate命令来同步时间,所以需要配合定时任务,来定时执行命令,CentOS8则不需要。

centos7+ 支持chrony时间同步配置,ntpdate在centos8上已经不再支持了
chrony相比ntp时间同步配置更简单,更高效
timedatectl 是 centos7+上的一个时间客户端工具
服务器上没有chrony的可以使用 yum -y install chrony 进行安装

 

服务端

可连接外网

vim /etc/chrony.conf

 

 然后对防火墙进行设置策略,允许服务的通行

firewall-cmd --permanent --add-service=ntp

firewall-cmd --reload

firewall-cmd --permanent --remove-service=chrony

 

重启

systemctl restart chronyd.service

 

客户端

(不可联网 需要做代理  yum下载chrony)

vim /etc/chrony.conf

 

 server 192.168.0.123 iburst

 

重启

systemctl restart chronyd.service

 

date显示成功

posted @   奋斗!奋斗!  阅读(272)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 2025年我用 Compose 写了一个 Todo App
· 张高兴的大模型开发实战:(一)使用 Selenium 进行网页爬虫
点击右上角即可分享
微信分享提示