NTP时间同步服务器设置
一、Window Server设置
【服务器端设置】
1) 修改注册表以下键值:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer\Enabled=1
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config\AnnounceFlags=5
2) 重启NTP服务
net stop w32Time && net start w32Time
3) 调整防火墙设置,开启NTP端口
【客户端设置】
方法1) <-该方法未测试成功
修改注册表以下键值:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient\SpecialPollInterval=43200 (十进制)
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient\SpecialPollTimeRemaining=192.168.1.1,0 (192.168.1.1替换为实际的NTP服务器IP)
方法2) <-该方法经测试有效
net time /setsntp:"192.168.1.1,0x01"
net stop w32Time && net start w32Time
w32tm /resync /nowait /rediscover
二、Linux
安装NTP:
yum install ntp
配置时间源
vi /etc/ntp.conf
server 210.72.145.44
server ntp.api.bz
server 2.centos.pool.ntp.org
配置对客户端(172.16.0.0/24的网段机器)提供NTP服务
# vi /etc/ntp.conf
restrict 172.16.0。0 mask 255.255.255.0 nomodify notrap
配置NTP Server的层数提供本地服务
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 2
设置开机时自动运行时间服务
chkconfig ntpd on
启动或停止时间服务
# service ntpd start
# service ntpd stop
# service ntpd restart
验证ntp服务已经运行
pgrep ntpd
更新本服务器的时间
ntpdate -u 210.72.145.44
配置iptable规则允许客户端访问本机NTP Sever
vi /etc/sysconfig/iptables
增加一行(NTP Server使用UDP 123端口)
-A INPUT -m state --state NEW -m udp -p udp --dport 123 -j ACCEPT
重启iptables
service iptables restart
NTP时间同步服务器设置的更多相关文章
- centos7搭建ntp时间同步服务器chrony服务
centos7搭建ntp时间同步服务器chrony服务 前言: 在centos6的时候我们基本使用的是ntp服务用来做时间同步,但是在centos7后推荐是chrony作为时间同步器的服务端使用, ...
- 张高兴的 .NET IoT 入门指南:(八)基于 GPS 的 NTP 时间同步服务器
时间究竟是什么?这既可以是一个哲学问题,也可以是一个物理问题.古人对太阳进行观测,利用太阳的投影发明了日晷,定义了最初的时间.随着科技的发展,天文观测的精度也越来越准确,人们发现地球的自转并不是完全一 ...
- ntp时间同步服务器
[root@localhost ~]# ntpdate time.nist.gov 虚拟机时间不对 自动同步 sudo ntpdate asia.pool.ntp.org 要是同步后时间还是不 ...
- 【Linux】部署NTP时间同步服务器
1. 查看机器的Linux版本 查看集群内所有服务器的linux版本,确保相同,不要跨大版本. [root@bigdata111 ~]# cat /etc/redhat-release CentOS ...
- .bat脚本将windows server 2008设置成ntp时间同步服务器
@echo off echo autor OAK @echo off echo -------------------------------- @echo off REG ADD HKEY_LOCA ...
- ntp时间同步服务器的搭建
CentOS系统一般自带安装有ntp服务,仅需做相关配置即可. 一.配置ntp服务器: 在选定的ntp服务器上vim /etc/ntp.conf 添加一行:restrict default nomod ...
- 【转】Linux配置NTP时间同步服务器
分布式程序通常需要运行在一个统一的时间环境里. 转自:http://blog.csdn.net/mengfanzhundsc/article/details/62046562 安装NTP:yum in ...
- Linux下搭建ntp时间同步服务器
1.ntpd软件安装(略过) 2.修改ntp.conf配置文件 vi /etc/ntp.conf 第一种配置:允许任何IP的客户机都可以进行时间同步将“restrict default kod nom ...
- CentOS装个NTP时间同步服务器
服务端: driftfile /var/lib/ntp/drift restrict default nomodify notrap nopeer noquery restrict 127.0.0.1 ...
随机推荐
- Isolation-based Anomaly Detection
Anomalies are data points that are few and different. As a result of these properties, we show that, ...
- Ubuntu Git 入门
参考自 码农生涯 中大熊猫 hustpzb的专栏 1 在github创建账号--创建repository 2 创建后网页会出现提示,指导如何使用 3 安装git sudo apt-get instal ...
- NSOperation实现线程间通信
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event { //1.创建队列 NSOperat ...
- 深入理解JavaScript系列:各种上下文中的this
开头闲扯几句.上篇写对象原型的文章获得了1K多的阅读和几条评论,心里还是蛮欣喜的.那种写出来然后有人跟你讨论的感觉很不错. 公告里已经有写,自己开这个博客以及为什么要写文章的原因就是为了能把自己所思所 ...
- C# ListView 自定义ToolTip 显示
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...
- 响应式图片srcset学习
响应式图片srcset全新释义sizes属性w描述符 先转再看
- 黑马------synchronized详解
黑马程序员:Java培训.Android培训.iOS培训..Net培训 JAVA线程-synchronized详解 一.synchronized概述 1.线程间实现互斥,必须使用同一个监视器(一个对象 ...
- JS控制的动态表格
对应的js: function pccAddSignRow() { //读取最后一行的行号,存放在LearnTRLastIndex文本框中 var pccTRLastIndex = findObj(& ...
- [转帖]网络协议封封封之Panabit配置文档
原帖地址:http://myhat.blog.51cto.com/391263/322378
- Matlab代码优化--向量化
前段时间改写老师的一个计算纳米细颗粒物的C语言程序,不过运行的效率实在是太低了,工作站跑都很吃劲,晚上看了冈萨雷斯的数字图像处理意外发现了问题所在.在将C语言的程序改写成Matlab程序的时候我还是保 ...