当前位置:网站首页>搭建企业级NTP时间服务器
搭建企业级NTP时间服务器
2022-06-29 23:02:00 【星哥玩云】
一、简介:
NTP(NetworkTime Protocol,网络时间协议)是用来在分布式时间服务器和客户端之间进行时间同步。NTP基于UDP报文进行传输,使用的UDP端口号为123。
使用NTP的目的是对网络内所有具有时钟的设备进行时钟同步,使网络内所有设备的时钟保持一致,从而使设备能够提供基于统一时间的多种应用。
对于时间错误会导致服务器宕机,所以运行NTP的本地系统,既可以接受来自其他时钟源的同步,又可以作为时钟源同步其他的时钟,并且可以和其他设备互相同步。
二、搭建时间服务器(服务端)
1.搭建环境
环境:CentOS6.4
Server192.168.126.1
Client192.168.126.2
2.安装NTP yum –yinstall ntp
3.修改配置文件添加这一行vim /etc/ntp.conf
restrict 192.168.126.0255.255.255.0 nomodify notrap
4.找到这两行去掉注释 vi /etc/ntp.conf
#server127.127.1.0
#fudge127.127.1.0stratum 10
5.开机启动服务
Chkconfig --level 345 ntpon
6.启动服务
/etc/init.d/ntpd start
7. 防火墙需要开123端口或者关闭防火墙
-A INPUT -m state --state NEW -m tcp -p tcp --dport 123 -jACCEPT
三、客户端
1.与服务端同步时间执行以下命令
手工执行或用crontab来执行
手工:ntpdate 192.168.126.1
crontab –e
0 21 * * * ntpdate 192.168.126.1 >> /root/ntpdate.log 2>&1
2.查看同步状况 ntpq –p
3.防火墙需要开123端口或者关闭防火墙
-A INPUT -m state --state NEW -m tcp -p tcp --dport 123 -jACCEPT
边栏推荐
- C指针进阶2-->函数指针数组 回调函数简化计算器代码,基于回调函数模拟实现qsort函数
- Status acquisition and control system of on-site express cabinet
- Mysql database: the difference between drop, truncate and delete
- 基金的估值,费用,会计核算
- JS function related review
- Mysql database: use the show profile command to analyze performance
- C指针进阶1-->字符指针,数组指针,指针与数组传参,函数指针
- The development of grpc
- 远程沟通高效的自我总结| 社区征文
- 众昂矿业:萤石助力氟产业锂电建设发展
猜你喜欢

How to solve the problem that the computer time is not automatically updated after proofreading

Redis client
discrete "digital signal"]"/>Speech signal processing (III): speech signal analysis [continuous "analog signal" -- Sampling, quantization, coding -- > discrete "digital signal"]

Processing of error b6267342 reported by AIX small machine in production environment

C pointer advanced 2-- > function pointer array callback function simplifies calculator code, and implements qsort function based on callback function simulation

正则表达式:字符(2)

Still stay up late every day and work overtime to make statements? In fact, you don't know how to make reports efficiently

Wechat applet: (update) cloud development wechat group contacts

Touch key and key control corresponding LED status reversal

Speech signal processing (II): phonation physiology, auditory physiology and auditory psychology
随机推荐
[learn FPGA programming from scratch -51]: high level chapter - FPGA development based on IP core - what is FPGA IP core (soft core, fixed core, hard core) and learning methods
Taishan Office Technology Lecture: all elements in a row have the same height
Software testing interface testing postman testing tool interface testing process execution interface testing interface associated environment variables and global variables built-in dynamic parameter
InfluxDB时序数据库系统
Design of Distributed Message Oriented Middleware
Laravel creates its own facade extension geoip to obtain country, region and city information according to IP
Solr基础操作1
js函数相关的复习
股票开户安全吗?上海股票开户。
Golang code specification sorting
基金的信息披露
关于 Apache 的 25 个初中级面试题
80-Redis详解
Gracefully transform the SMS business module and start the strategic mode!
sql刷题595. 大的国家
How ZABBIX 5.0 adds esxi6.7 to monitoring
How to solve the problem that the computer time is not automatically updated after proofreading
语音信号处理(三):语音信号分析【连续的“模拟信号”--采样、量化、编码-->离散的“数字信号”】
Procurement intelligence is about to break out, and the "3+2" system of Alipay helps enterprises build core competitive advantages
众昂矿业:萤石助力氟产业锂电建设发展