美文网首页
NTP服务器

NTP服务器

作者: 丶Daniel | 来源:发表于2019-12-14 02:07 被阅读0次

NTP安装部署
1.安装软件ntpdate
[root@m01 ~]# yum install -y ntp ntpdate
2.备份ntp服务器配置文件
[root@m01 ~]# cp /etc/ntp.conf /etc/ntp.conf.bak
3.精简优化配置文件
[root@m01 ~]# egrep -v "^$|#" /etc/ntp.conf.bak >/etc/ntp.conf
4.编辑配置文件
[root@m01 ~]# vim /etc/ntp.conf
ftfile /var/lib/ntp/drift
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict -6 ::1

允许内网其他机器同步时间

restrict 172.16.1.0 mask 255.255.255.0 nomodify notr

server 0.centos.pool.ntp.org iburst

server 1.centos.pool.ntp.org iburst

server 2.centos.pool.ntp.org iburst

server 3.centos.pool.ntp.org iburst

定义使用的上游 ntp服务器,将原来的注释

server ntp1.aliyun.com
server time1.aliyun.com

允许上层时间服务器主动修改本机时间

restrict time1.aliyun.com nomodify notrap noquery
restrict ntp1.aliyun.com nomodify notrap noquery

外部时间服务器不可用时,以本地时间作为时间服务

server 127.127.1.0
fudge 127.127.1.0 stratum 10
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
5.启动NTP服务器和显示节点列表

[root@m01 ~]# systemctl start ntpd
[root@m01 ~]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
120.25.115.20 10.137.53.7 2 u 8 64 1 32.515 2.672 0.000
203.107.6.88 10.137.38.86 2 u 7 64 1 24.061 4.179 0.000
*LOCAL(0) .LOCL. 10 l 6 64 1 0.000 0.000 0.000
6.客户端测试

[root@web01 ~]# date -s 20190825 #更改时间
Sun Aug 25 00:00:00 CST 2019

[root@web01 ~]# ntpdate 172.16.1.61 #同步测试
2 Oct 09:22:40 ntpdate[1606]: adjust time server 172.16.1.61 offset 0.001950 sec

相关文章

  • ntp时间同步配置

    安装 ntp 修改ntp配置文件 vi /etc/ntp.conf 添加内网ntp服务器。 systemctl s...

  • 如何安装和配置 Chrony 作为 NTP 客户端?

    NTP 服务器和 NTP 客户端可以让我们通过网络来同步时钟。之前,我们已经撰写了一篇关于NTP 服务器和 NTP...

  • (8)Linux_服务篇_NTP_DHCP

    NTP 描述:中心时间服务器,用于局域网服务器时间同步 安装软件:ntp 1. 配置路径:vim /etc/ntp...

  • 使用dokcer镜像快速搭建ntp服务器实现时间同步

    使用镜像搭建ntp服务器,并在客户端调用进行定时时间同步。 一、 ntp服务器搭建 查询到有现成的ntp服务器do...

  • 2018-04-16

    Linux对时 在NTP服务器上,即一般都是用于对时的前置服务器,修改/etc/ntp/ntp.conf,在该文件...

  • 时间服务器NTP

    默认的NTP服务器端口是123如果利用trimble NetR9开启NTP服务器,首先需要开启NTP服务,然后在端...

  • NTP服务器

    ntp server 启动/重启/关闭/查询状态ntp server 添加主机同步服务器 在/etc/ntp.co...

  • linux时间同步ntp服务的安装与配置

    安装NTP(server client) Server机器修改NTP配置文件,添加NTP服务器的网络位置 vi ...

  • 第十三周

    1、搭建时间服务器,日志服务器并简述sudo安全切换 1)安装ntp服务器 yum install ntp 配置文...

  • 集群时间同步

    时间服务器 1)检查ntp是否安装(此处默认已经安装) $ rpm -qa | grep ntp 2)修改ntp配...

网友评论

      本文标题:NTP服务器

      本文链接:https://www.haomeiwen.com/subject/rrdqnctx.html