场景:
- 一般部署大数据相关应用服务,各个节点之间需要时间同步;
- 内网情况下,很可能各节点之前时间可能不一致,或者过一段时间后 又不一致了
ntp 时钟服务器:
- 可用于内网各个节点之前得时间同步,安全方便。
- 大致有个 ntp-server 各个 节点有个 ntp-client 间隔一段时间就去同步 服务端得时间。
流程图:
安装配置:
centos7-rpm包分享下载
在有网环境自我导出:
yum install --downloadonly --downloaddir=/opt compat-openssl ntp ntpdate
# 各个节点安装
rpm -ivh compat-openssl10-1.0.2o-3.el8.x86_64.rpm
rpm -ivh ntp-4.2.6p5-29.el7.centos.2.x86_64.rpm
rpm -ivh ntpdate-4.2.6p5-29.el7.centos.2.x86_64.rpm
配置文件修改-
server端:
- vi /etc/ntp.conf
# For more information about this file, see the man pages
# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).
driftfile /var/lib/ntp/drift
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default nomodify notrap nopeer noquery
# Permit all access over the loopback interface. This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict

本文介绍了在CentOS7环境中部署和配置NTP服务以实现内网节点间的时间同步。包括安装RPM包、配置ntp.conf文件、指定服务器地址,以及启动和查看NTP客户端状态的步骤。

最低0.47元/天 解锁文章
4165

被折叠的 条评论
为什么被折叠?



