博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
NTP服务器
阅读量:7102 次
发布时间:2019-06-28

本文共 1309 字,大约阅读时间需要 4 分钟。

NTP服务器

  • NTP 服务器运行原理
  • 实战配置NTP服务器为内网络服务器同步时间
  • 配置NTP客户端同步时间

NTP(Network Time Protocol,网络时间协议)是用来使计算机时间同步化的一种协议。它可以使计算机对其服务器或时钟源做同步化,它可以提供高精准度的时间校正(LAN上与标准时差小于1毫秒,WAN上几十毫秒),且可以由加密确认的方式来防止恶毒的协议***。

模式:C/S

端口

[root@localhost ~]# cat /etc/services|grep -w ^ntpntp             123/tcpntp             123/udp                         # Network Time Protocol

安装 NTP 服务器

[root@localhost Packages]# yum install ntp -y[root@localhost Packages]# rpm -q ntpntp-4.2.6p5-25.el7.centos.2.x86_64

配置文件/etc/ntp.conf

启动服务

[root@localhost ~]# systemctl start ntpd.service

查看端口

NTP服务器

安装 NTP 客户端

[root@apenglinux-002 Packages]# rpm -ivh ntpdate-4.2.6p5-25.el7.centos.2.x86_64.rpm[root@apenglinux-002 Packages]# rpm -q ntpdatentpdate-4.2.6p5-25.el7.centos.2.x86_64

NTP 客户端同步时间

ntpdate ntpServerIP 或 ntpServerName

公网上的 ntp 服务器

NTP服务器
NTP服务器

[root@localhost ~]# systemctl stop ntpd.service [root@localhost ~]# ntpdate 0.centos.pool.ntp.org  5 Apr 12:34:33 ntpdate[2425]: adjust time server 193.228.143.14 offset 0.002047 sec

搭建一个内网NTP服务器,让内网服务器通过此NTP服务器进行时间同步

修改NTP服务器配置文件 /etc/ntp.conf

NTP服务器

列出是否与上游服务器连接,需要过5分钟

NTP服务器

列出ntp与上层ntp的状态

NTP服务器
remote:即 remote-本机和上层ntp的ip或主机名,“+” 表示优先,“ *” 表示次优先
refid:参考的上一层NTP主机的地址
st:即 stratum 阶层
poll:下次更新在几秒之后
offset:时间补偿的结果

linux系统时间和BIOS时间是不是一样?

# hwclock -r //读出BIOS的时间# hwclock -w //将当前系统时间写入BIOS中

转载于:https://blog.51cto.com/13480443/2095004

你可能感兴趣的文章
Docker容器的数据卷(data volume),数据卷容器,数据卷的备份和还原。
查看>>
win10 字体渲染优化 色彩调整
查看>>
分享基于MemoryCache(内存缓存)的缓存工具类,C# B/S 、C/S项目均可以使用!
查看>>
VC++:ActiveX Test Container
查看>>
iOS知识点汇总
查看>>
butterknife用法总结
查看>>
Win8 Metro(C#)数字图像处理--2.55OSTU法图像二值化
查看>>
ReactiveCocoa 中 RACSignal 所有变换操作底层实现分析(上)
查看>>
Service Fabric本地开发部署修改数据目录
查看>>
php面试题
查看>>
Hexo NexT 博客本地搭建指南
查看>>
快速使用CSS Grid布局,实现响应式设计
查看>>
这并不是习惯,而是忍耐力变强了
查看>>
NAS是什么
查看>>
2018-04-12
查看>>
linux内核支持U-disk和U转串
查看>>
PHP服务器端API原理及示例讲解(接口开发)
查看>>
erlang遍历目录
查看>>
Stanford CS231n实践笔记(课时14卷积神经网络详解 上)
查看>>
文章标题
查看>>