ntp时间同步问题解决方法

亚洲 - asia.pool.ntp.org http://www.pool.ntp.org/zone/asia
0.asia.pool.ntp.org
1.asia.pool.ntp.org
2.asia.pool.ntp.org
3.asia.pool.ntp.org

成都创新互联专注于网站建设、成都做网站、网页设计、网站制作、网站开发。公司秉持“客户至上,用心服务”的宗旨,从客户的利益和观点出发,让客户在网络营销中找到自己的驻足之地。尊重和关怀每一位客户,用严谨的态度对待客户,用专业的服务创造价值,成为客户值得信赖的朋友,为客户解除后顾之忧。

2.1 注册表信息修改
PDC配置外部时间源设置

#config external NTP server
w32tm.exe /config /manualpeerlist:”0.asia.pool.ntp.org,1.asia.pool.ntp.org,2.asia.pool.ntp.org,3.asia.pool.ntp.org,0x1” /syncfromflags:manual /reliable:YES /update

#update
w32tm.exe /config /update
#此处可以在配置过程中不使用,在配置不生效的情况下再执行关闭和开启服务器的动作
#stop w32time
Stop-Service W32Time
#start w32time
start-Service w32time

#internal NTP for PDC
Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\W32Time\Parameters" -Name "Type" -Value NTP
Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\W32Time\Config" -Name "AnnounceFlags" -Value 5
Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer" -Name "Enabled" -Value 1
Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient" -Name "SpecialPollInterval" -Value 900
说明:
以上代码配置可以直接对PDC配置外部时间源,同时针对客户端的更细频率等参数进行设置,设置可以根据客户的实际要求酌情进行调整

2.1.1 指定外部时间源
w32tm /config /manualpeerlist:"time.stdtime.gov.tw clock.stdtime.gov.tw tick.stdtime.gov.tw watch.stdtime.gov.tw,0x1" /syncfromflags:manual /reliable:yes /update
ntp时间同步问题解决方法
2.1.2 设置授权时间服务器
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config"
[AnnounceFlags]修改设定值为5

ntp时间同步问题解决方法
2.1.3 启用NTP服务
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters" [Type]设定值修改为NTP
ntp时间同步问题解决方法
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer" [Enabled]数值修改为1

ntp时间同步问题解决方法

2.1.4 设定查询时间间隔
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient" [SpecialPollInterval]修改数值为"十进制"600
ntp时间同步问题解决方法
2.1.5 时间修正设置
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config"
[MaxPosPhaseCorrection]修改为十进制6000 (负差校正) – 若网络时间比本地时间慢超过这个秒数就不自动更正
[MaxNegPhaseCorrection]修改为十进制6000 (正差校正) – 若网络时间比本地时间快超过这个秒数就不自动更正
ntp时间同步问题解决方法

2.1.6 开启时间服务端口
netsh firewall add portopening protocol=UDP port=123 name=NTPSERVER

ntp时间同步问题解决方法

2.1.7 重启Time32时间服务并同步外部时间源
Net stop w32time & net start w32time //重启w32time时间服务器
W32tm /config /update //更新时间服务配置信息
W32tm /resync //同步时间源
w32tm /query /peers //查询时间同步服务器及相关情报
W32tm /query /source //查看同步时间源
ntp时间同步问题解决方法
2.2 修改AD相关设置

2.2.1 设置AD时间源服务器
ntp时间同步问题解决方法

2.2.2 修改PDC服务器使用内部时间源
ntp时间同步问题解决方法
2.2.3 组策略设置
ntp时间同步问题解决方法
3 同步时间测试
没有加域的客户端第一次需要运行同步时间脚本,来指定内部NTP服务器进行时间同步
脚本 内容如下:
@echo off
color 2f
title 调整 Time
echo.
echo.
echo.
echo. 开启防火墙123端口
netsh firewall add portopening protocol = UDP port =123 name = NTPSERVER
echo.
echo.
echo.
echo. 写入注册表信息
w32tm /config /update /manualpeerlist:"172.16.108.7 ntp.fudan.edu.cn s1b.time.edu.cn s1c.time.edu.cn,0x1"
echo.
echo.
echo.
echo. 重启w32time服务
net stop w32time & net start w32time
echo.
echo.
echo.
echo. 更新时间配置
w32tm /config /update
w32tm /config /update
w32tm /config /update
w32tm /resync
w32tm /resync
w32tm /resync
w32tm /resync
w32tm /resync
w32tm /resync
pause
经过反复测试,客户端可以成功同步时间服务器时间;

查看注册表分支:[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient],找到Enabled,修改0为1,然后重启时间同步服务即可;
同步时间遇到“找不到元素”时这样操作可以解决。

文章标题:ntp时间同步问题解决方法
标题路径:https://www.cdcxhl.com/article24/gipice.html

成都网站建设公司_创新互联,为您提供网站维护商城网站标签优化响应式网站电子商务网站内链

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

外贸网站制作