windows、Linux同步外网NTP服务器时间

素颜马尾好姑娘i 2021-09-29 21:58 759阅读 0赞

配置 Windows 时间服务以使用外部时间源


要将内部时间服务器配置为与外部时间源同步,请使用以下方法之一:

软件自动配置 Windows 时间服务

若要自动修复此问题,请单击“下载”按钮。 在“文件下载”对话框中,选择 “运行” 或“打开”,然后按照 Easy fix 向导中的步骤操作。

运行 Easy fix 解决方案配置外部时间源时,需要指定 NTP 服务器的名称。 Easy fix 解决方案将具有占位符名称 Server1 和 Server2。 将这些占位符名称替换为 NTP 服务器的名称且后跟““,0x1””,即ntp3.aliyun.com,0x1

  • SpecialPollInterval、MaxPosPhaseCorrection 和 MaxNegPhaseCorrection 设置的时间单位为秒。
  • 链接:https://pan.baidu.com/s/1fyh-iYcoi6XKOjO3J2jikQ
    提取码:nmcd

    NTP 服务器列表

        • 阿里云授时服务器

          NTP服务器

          ntp1.aliyun.com
          ntp2.aliyun.com
          ntp3.aliyun.com
          ntp4.aliyun.com
          ntp5.aliyun.com
          ntp6.aliyun.com
          ntp7.aliyun.com

          Time服务器

          time1.aliyun.com
          time2.aliyun.com
          time3.aliyun.com
          time4.aliyun.com
          time5.aliyun.com
          time6.aliyun.com
          time7.aliyun.com

          国内大学授时服务器

          s1c.time.edu.cn 北京大学
          s2m.time.edu.cn 北京大学
          s1b.time.edu.cn 清华大学
          s1e.time.edu.cn 清华大学
          s2a.time.edu.cn 清华大学
          s2b.time.edu.cn 清华大学
          ntp.sjtu.edu.cn     上海交通大学

          国外授时服务器

          苹果提供的授时服务器

          time1.apple.com
          time2.apple.com
          time3.apple.com
          time4.apple.com
          time5.apple.com
          time6.apple.com
          time7.apple.com

          Google提供的授时服务器

          time1.google.com
          time2.google.com
          time3.google.com
          time4.google.com

  • 手动修改 Windows 时间服务

修改默认NTP服务器地址

Windows Server操作系统默认配置微软NTP服务器(time.windows.com),但是可能经常同步出错。您可以将默认NTP服务器更换成阿里云提供的NTP服务器。

按以下步骤修改默认NTP服务器地址:

  1. 在任务栏的通知区域,单击日期和时间,并单击 更改日期和时间设置
  2. 日期和时间 对话框里,单击 Internet 时间 选项卡,并单击 更改设置
  3. Internet 时间设置 对话框里,选择 与Internet时间服务器同步,填写一个阿里云NTP服务器地址,并单击 立即更新

1444659-20190426083136140-302957854.png

修改NTP服务时间同步间隔

NTP服务的时间同步间隔默认是5分钟,您可以根据业务需求自定义同步间隔。按以下步骤修改时间同步间隔:

  1. 选择 开始 > 所有程序 > 附件 > 运行,打开 运行 对话框,并运行命令 regedit。
  2. 注册表编辑器 的左侧目录树中,找到 HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > services > W32Time > TimeProviders > NtpClient,并双击SpecialPollInterval键值。
  3. 编辑 DWORD (32 位)值 对话框中,在 基数 栏里选择 十进制,并按需要填写 数值数据。填入的数值即是您需要的同步时间间隔(单位为秒)。

Linux设置方法

https://www.cnblogs.com/xiaoerlang/p/6576610.html

首先安装NTP:

yum install ntp

修改/etc/ntp.conf

  1. server ntp1.aliyun.com prefer
  2. server ntp2.aliyun.com

手工发起同步:ntpdate ntp1.aliyun.com
启动NTP服务:service ntpd start
设置开机启动:chkconfig ntpd on
检查设置:chkconfig --list ntpd

参考:https://help.aliyun.com/document\_detail/51890.html

  1. https://help.aliyun.com/document\_detail/92803.html?spm=a2c4g.11186623.2.21.411549eaNJ3FsK
  2. https://help.aliyun.com/document\_detail/92704.html?spm=a2c4g.11186623.2.14.411549eaNJ3FsK\#TimeCalibrationNTP
  3. https://support.microsoft.com/zh-cn/help/816042/how-to-configure-an-authoritative-time-server-in-windows-server
  4. https://www.jianshu.com/p/28864ab7fdd9
  5. https://yq.aliyun.com/articles/668836
  6. https://blog.kelu.org/tech/2018/12/03/ntp-for-centos.html Linux

转载于:https://www.cnblogs.com/xiaoyou2018/p/10656062.html

发表评论

表情:
评论列表 (有 0 条评论,759人围观)

还没有评论,来说两句吧...

相关阅读

    相关 NTP时间同步

    1. 时区及GMT 地球共分为24个时区,按一圈360度计算,每个时区的跨度是15度。国际上约定以0度经线穿过的城市格林威治的时间作为标准时间(Greenwich