NTP服务部署测试

本文档详细介绍了在CentOS系统上部署NTP服务的过程,包括配置文件的修改,设置NTP服务器同步阿里云时间服务,并验证内网客户机的时间同步。此外,还提供了使用chronyc工具检查同步状态和调整时区的方法。
摘要由CSDN通过智能技术生成

一、环境说明  

 10.10.117.95  可以访问公网 同步阿里云 NTP 时间服务  作为内网NTP server

 10.10.239.117 内网客户机同步内网NTP server

部署NTP server

修改配置文件 添加阿里云NTP服务,关闭内核同步,开启允许客户端访问。

[root@mon ~]# vim /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 0.centos.pool.ntp.org iburst               # #注释掉系统默认的NTP服务
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server ntp1.aliyun.com iburst                    #添加4台阿里云 NTP服务器
server ntp2.aliyun.com iburst
server ntp3.aliyun.com iburst
server ntp4.aliyun.com iburst
# Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift

# Allow the system clock to be stepped in the first three updates
# if its offset is larger than 1 second.
makestep 1.0 3

# Enable kernel synchronization of the real-time clock (RTC).
#rtcsync                                     # 关闭实时时钟内核同步  

# Enable hardware timestamping on all interfaces that support it.
#hwtimestamp *

# Increase the minimum number of selectable sources required to adjust
# the system clock.
#minsources 2

# Allow NTP client access from local network.
#allow 192.168.0.0/16
allow 0.0.0.0/0                              #允许本地网络的NTP客户端访问
……………………

[root@mon ~]# systemctl enable chronyd      #设置开机启动

[root@mon ~]# systemctl restart chronyd       # 重启服务

[root@mon ~]# systemctl status chronyd       #

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值