标签:同步 centos ntp wlnmp ntpdate org pool CentOS8
老机器上时间同步可能会带来其他未知问题。
时间同步问题我了解皮毛而已,这里我的业务可以使用,方法仅供参考。
一、烦
centos 8 执行 ntpdate 会出现以下错误
No match for argument: ntpdate Error: Unable to find a match: ntpdate
原因:在CentOS8.0中默认不再支持ntp软件包,时间同步将由chrony来实现
二、解决方法
1. 通过wlnmp方式
添加wlnmp的yum源
# rpm -ivh http://mirrors.wlnmp.com/centos/wlnmp-release-centos.noarch.rpm
安装ntp服务
# yum -y install wntp
时间同步
# ntpdate ntp1.aliyun.com
2. 通过同步目标服务器方式
2.1.centos8 里是预安装的,没有安装的话执行以下命令:
# yum -y install chrony
2.2. 启动并加入开机自启动(根据实际情况选择或不选)
# systemctl enable chronyd.service
# systemctl restart chronyd.service
# systemctl status chronyd.service
2.3. 修改配置文件
vi /etc/chrony.conf
原配置
2 # Please consider joining the pool (http://www.pool.ntp.org/join.html).
3 pool 2.centos.pool.ntp.org iburst
修改
2 # Please consider joining the pool (http://www.pool.ntp.org/join.html).
3 pool 2.centos.pool.ntp.org iburst
server 目标服务器IP iburst
保存退出,重启chronyd服务。
本文出现任何错误,请留言批评指正。
标签:同步,centos,ntp,wlnmp,ntpdate,org,pool,CentOS8 来源: https://blog.csdn.net/weixin_46623617/article/details/110523865
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。