ntp时钟服务安装- 局域网节点时间同步

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

场景:

  • 一般部署大数据相关应用服务,各个节点之间需要时间同步
  • 内网情况下,很可能各节点之前时间可能不一致,或者过一段时间后 又不一致了

ntp 时钟服务器:

  • 可用于内网各个节点之前得时间同步,安全方便。
  • 大致有个 ntp-server 各个 节点有个 ntp-client 间隔一段时间就去同步 服务端得时间。

流程图:
1

安装配置:
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 
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值