一、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时间同步服务器设置的更多相关文章

  1. centos7搭建ntp时间同步服务器chrony服务

    centos7搭建ntp时间同步服务器chrony服务 前言: 在centos6的时候我们基本使用的是ntp服务用来做时间同步,但是在centos7后推荐是chrony作为时间同步器的服务端使用, ...

  2. 张高兴的 .NET IoT 入门指南:(八)基于 GPS 的 NTP 时间同步服务器

    时间究竟是什么?这既可以是一个哲学问题,也可以是一个物理问题.古人对太阳进行观测,利用太阳的投影发明了日晷,定义了最初的时间.随着科技的发展,天文观测的精度也越来越准确,人们发现地球的自转并不是完全一 ...

  3. ntp时间同步服务器

    [root@localhost ~]# ntpdate time.nist.gov 虚拟机时间不对   自动同步   sudo ntpdate asia.pool.ntp.org 要是同步后时间还是不 ...

  4. 【Linux】部署NTP时间同步服务器

    1. 查看机器的Linux版本 查看集群内所有服务器的linux版本,确保相同,不要跨大版本. [root@bigdata111 ~]# cat /etc/redhat-release CentOS ...

  5. .bat脚本将windows server 2008设置成ntp时间同步服务器

    @echo off echo autor OAK @echo off echo -------------------------------- @echo off REG ADD HKEY_LOCA ...

  6. ntp时间同步服务器的搭建

    CentOS系统一般自带安装有ntp服务,仅需做相关配置即可. 一.配置ntp服务器: 在选定的ntp服务器上vim /etc/ntp.conf 添加一行:restrict default nomod ...

  7. 【转】Linux配置NTP时间同步服务器

    分布式程序通常需要运行在一个统一的时间环境里. 转自:http://blog.csdn.net/mengfanzhundsc/article/details/62046562 安装NTP:yum in ...

  8. Linux下搭建ntp时间同步服务器

    1.ntpd软件安装(略过) 2.修改ntp.conf配置文件 vi /etc/ntp.conf 第一种配置:允许任何IP的客户机都可以进行时间同步将“restrict default kod nom ...

  9. CentOS装个NTP时间同步服务器

    服务端: driftfile /var/lib/ntp/drift restrict default nomodify notrap nopeer noquery restrict 127.0.0.1 ...

随机推荐

  1. Linq中关键字的作用及用法

    Linq中关键字的作用及用法 1.All:确定序列中的所有元素是否都满足条件.如果源序列中的每个元素都通过指定谓词中的测试,或者序列为空,则为 true:否则为 false. Demo: 此示例使用 ...

  2. HTMlhleper

    @{ ViewBag.Title = "Index";} <h2>Index</h2> <div> @{ int id=12121; var I ...

  3. 在web.config配置中添加xml内容

    在web.config 中添加需要的内容时, 就是在<configuration>节点内添加一个新的<configSections>元素, 在configSections元素中 ...

  4. ORACLE各种小指令

    清空表中所有记录truncate table et_xxxxxx 删除一条数据 DELETE FROM zhubajie_member.mb_web_login WHERE nickname='m_3 ...

  5. Java 验证码工具类

    package com.wuyu.util; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import ...

  6. js日期重写

    Date.prototype.Format = function (fmt) { var o = { "M+": this.getMonth() + 1, //月份 "d ...

  7. The first day to learn Englisht

    IF you want to go fast,to alone. IF you want to go far,go with others.

  8. 龙哥库塔法or欧拉法求解微分方程matlab实现

    举例:分别用欧拉法和龙哥库塔法求解下面的微分方程 我们知道的欧拉法(Euler)"思想是用先前的差商近似代替倒数",直白一些的编程说法即:f(i+1)=f(i)+h*f(x,y)其 ...

  9. BZOJ 3176 Sort

    先一遍reverse+逆序对个数. 要开long long啊. #include<iostream> #include<cstdio> #include<cstring& ...

  10. jieba中文分词(python)

    问题小结 1.安装 需要用到python,根据python2.7选择适当的安装包.先下载http://pypi.python.org/pypi/jieba/ ,解压后运行python setup.py ...