域内时间同步设置.docx

上传人:b****6 文档编号:7756512 上传时间:2023-01-26 格式:DOCX 页数:9 大小:200.04KB
下载 相关 举报
域内时间同步设置.docx_第1页
第1页 / 共9页
域内时间同步设置.docx_第2页
第2页 / 共9页
域内时间同步设置.docx_第3页
第3页 / 共9页
域内时间同步设置.docx_第4页
第4页 / 共9页
域内时间同步设置.docx_第5页
第5页 / 共9页
点击查看更多>>
下载资源
资源描述

域内时间同步设置.docx

《域内时间同步设置.docx》由会员分享,可在线阅读,更多相关《域内时间同步设置.docx(9页珍藏版)》请在冰豆网上搜索。

域内时间同步设置.docx

域内时间同步设置

域内时间同步设置

[url=file:

///]\\3.242.107.129[/url],如果是域内计算机,想查看当前域的整体时间nettime/domain:

shinseifin

3.显示时区

a)  Timedate.cpl

b)  W32tm/tz  显示本地计算机时区设置

4.  很多时间我们想知道,当前域内的计算机是从哪个服务器同步的时间,可以用如下命令:

W32tm/monitor/computers:

计算机名称

或者w32tm/monitor/domain:

域名

结果如下

这样如果发现域内时间异常,直接更改此对应PDC的计算机时间即可。

5.更改完时间后,我们希望让一台计算机立即进行同步

W32tm/resync/computer:

计算机名称

6.设置本地时间

上面提到直接使用time命令即可

7.设置一台与另外计算机时间同步

使用nettime命令。

格式如下

nettime[\\computername|/domain[:

domainname]|/rtsdomain[:

domainname]][/set]

nettime[\\computername][/querysntp]|[/setsntp[:

ntpserverlist]]

参数说明:

◆无参数,显示被指派为本地计算机的Windows服务器域时间服务器的当前时间。

◆\\computername,指定要检查或与之同步的服务器的名称。

 

◆/domain[:

domainname],指定要同步时间的域。

◆/rtsdomain[:

domainname],指定要与之同步的可信时间服务器所在的域。

◆/set,使计算机的时钟与指定的计算机或域的时间同步。

◆/querysntp,显示当前为本地计算机或\\computername所指定的计算机配置网络时间协议(NTP)服务器的名称。

◆/setsntp[:

ntpserverlist],指定本地计算机所使用的NTP时间服务器的列表。

该列表可以包含IP地址或DNS名称,用空格分开。

如果要使用多个时间服务器,该列表必须用引号引起来。

例如:

nettime[url=file:

///]\\3.242.107.142[/url]/querysntp查询使用哪一个sntp服务器

    Nettime[url=file:

///]\\3.242.107.143[/url]/setsntp:

time.windows.gov  指定计算机143与windowssntp服务器同步

    Nettime/set  [url=file:

///]\\3.242.107.142[/url]设置当前计算机与与142时间同步

通常用来设置服务器的时间与某一服务器同步。

二.如何设置PDC的服务器时间?

1.  将服务器设置为内部硬件时钟

打开Service注册表,HKEYLOCALMACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters中ReliableTimeSource与LocalNTP(二进制)均设置为1,重启服务,netstopw32tim&netstrartw32time

2.  将PDC的时间与公网服务器时间同步。

a)  nettime/setsntp:

192.43.244.18

b)  进入域控注册表修改Parameters

(1)将服务器类型改为NTP,即修改“TYPE”值为NTP。

(2)将该服务器配置为可靠的时间源,即修改“ReliableTimeSource”为1。

(3)修改“LocalNTP”值为1。

(4)指定时间源,即修改“NtpServer”为时间源地址。

(5)

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient]分支,并双击SpecialPollInterval键值,将对话框中的“基数栏”选择到“十进制”上,输入框中显示的数字正是自动对时的间隔(以秒为单位),比如默认的604800就是由7(天)×24(时)×60(分)×60(秒)计算来的。

设定时间同步周期(建议设为900=15分钟或3600=1小时等周期值),填入对话框,点击确定保存关闭对话框。

(6)  在命令提示符处,键入以下命令以重新启动Windows时间服务,然后按Enter键:

netstopw32time&&netstartw32time

三.同步域内时间的步骤小结:

1.  确定域内的PDC,  nettime/domain:

domain名称

2.  查询PDC使用的时间源nettime[url=file:

///]\\PDC的IP地址[/url]/QuerySntp

3.  修改PDC使用的时间源nettime[url=file:

///]\\PDC的IP地址[/url]/SetSntp:

事件源地址

4.  立即手动同步域内其他服务器的时间,使其与PDC保持一致。

  nettime/set或w32tm/resync/computer:

PDC(IP),建议使用后一个命令,前一个命令可能会出问题,问题描述见后面。

5.  手动设置各个服务器的时间源,指向PDC(计算机名或IP地址)

Nettime[url=file:

///]\\serverIP[/url]/setsntp:

PDC(IP)

默认情况下,域内的服务器的时间同步机制如下:

实例演示:

域信息:

域T,PDCServerIP地址为192.168.100;2台Server的IP地址分别为192.168.1.101;192.168.1.102

说明:

整个域内时间混乱,不同步,每个Server的时间都不一样

调整步骤:

1.  调试,查看整个域的时间源

在域内任意一台计算机,输入命令:

W32tm/monitor/domain:

,可以获取PDC的IP地址

2.  登陆PDCServer,调整PDC的时钟,使其其时间准确,并让其与微软服务器同步;

Nettime[url=file:

///]\\192.168.1.100[/url]/setsntp:

3.  PDC服务器时间准确后,马上调整server的时间源192.168.1,101/102

查看这2台Server的数据源

    Nettime[url=file:

///]\\192.168.1.101[/url]/Querysntp或是

    W32tm/monitor/computers:

192.168.1.101,192.168.1.102

修改数据源

Nettime[url=file:

///]\\192.168.1.101[/url]/SetSntp:

192.168.1.100

4.  设置时间源后,隔一段时间才能同步,我们可以手动设置立即同步

W32tm/resync/computer:

192.168.1.101

W32tm/resync/computer:

192.168.1.102

不建议使用nettime/set命令,因为有的系统不支持。

四.如何将Server服务器与PDC同步

用nettime确定PDC,建议最好用w32tm/monitor,得出的效果最好,可以直接看到PDC地址

首先需要确认PDC的时间,已经修改完毕,并且没有问题,

其次进入Server,运行nettime/set[url=file:

///]\\PDC[/url]名称或地址

如域服务器的机器名是Server,命令如下:

nettime[url=file:

///]\\Server[/url]/set[url=file:

///]\\PDC名称或地址[/url]/y

输入Y,立即同步,即可

五.Q&A问答:

1.为何当我使用nettime/set  /Y进行时间同步的时候,会出现异常,SystemError1314hasoccurred?

  出现以上问题,可以使用以下命令进行同步:

使用w32tm/resync/computer:

需要同步的计算机名称或IP地址,即可实现同步。

2.时间同步的层次关系及理论介绍

为确保合理地使用公共时间,Windows时间服务使用层级关系来控制授权,并且不允许出现循环。

默认情况下,基于Windows的计算机使用下面的层级:

所有客户端桌面计算机都提名身份验证域控制器作为其入站时间伙伴。

所有成员服务器都遵循与客户端桌面计算机相同的过程。

域中的所有域控制器都提名主域控制器(PDC)操作主机作为其入站时间伙伴。

所有PDC操作主机都遵循域的层级来选择其入站时间伙伴。

在此层级中,位于林根的PDC操作主机成为组织的权威时间服务器。

在典型配置中,AD域中的计算机以下列顺序同步时间:

1.域客户机或成员服务器向本域DC请求同步

2.一个域中的DC会向本域的PDC模拟器进行同步

3.所有非森林根域的PDC模拟器向森林根域的PDC模拟器同步

4.森林根域PDC模拟器配置为向外部时间源同步。

WindowsXP/2003及之后的时间服务使用NTP(网络时间协议)通过网络进行同步。

Windows时间服务的组件包括:

“ServiceControlManager”,“WindowsTimeServiceManager”,“ClockDiscipline”和“Timeproviders”。

行时间同步时,这些组件的工作过程如下:

n  “Inputproviders”向NTP时间源请求并接收时间样本。

n  时间样本被传递到”WindowsTimeServiceManager”。

n  “WindowsTimeServiceManager”收集所有样本,并将其传递到”ClockDiscipline”。

n  “ClockDiscipline”使用NTP算法选择最佳时间样本。

n  “ClockDiscipline”调整系统时钟频率或是直接更改时间

3.时间同步使用哪些协议?

第一种:

SNTP,是现在应用较多的一种网络时间协议,Windows域内的时间同步就是使用的这种协议,使用UDP123端口进行通讯

第二种:

TimeProtocol,服务器在TCP/UDP37端口上进行监听,这种协议只能使用到2036年

六.W32tm的使用,由微软的帮助命令获取的信息,人工翻译,欠缺之处见谅。

(1).w32tm/monitor[/domain:

]

          [/computers:

[,[,...]]]

          [/threads:

]

W32tm/monitor[/domain:

域名]或[/computers:

pc1,pc2,…]或者[/threads:

数目]

domain- specifieswhichdomaintomonitor.Ifnodomainname

  isgiven,orneitherthedomainnorcomputersoptionis

  specified,thedefaultdomainisused.Thisoptionmaybe

  usedmorethanonce.

  指定哪个域被监控,如果没有指定,则默认是当前的域

  computers -monitorsthegivenlistofcomputers.Computer

  namesareseparatedbycommas,withnospaces.Ifanameis

  prefixedwitha'*',itistreatedasaPDC.Thisoption

  maybeusedmorethanonce.

  监控多个计算机,计算机之间用逗号隔开,如果计算机名称前面加*号,代表当前计算机时PDC,会被特殊对待

  threads -howmanycomputerstoanalyzesimultaneously.The

  defaultvalueis3.Allowedrangeis1-50.

  指定多少计算机被同时分析,默认值为3,数字范围为1~50

(2).w32tm/ntte

  ConvertaNTsystemtime,in(10^-7)sintervalsfrom0h1-Jan1601,

  intoareadableformat.

  将当前时间设置为NT的时间类型,起始时间为1601年1月1号,只读模式

w32tm/ntpte

  ConvertanNTPtime,in(2^-32)sintervalsfrom0h1-Jan1900,into

  areadableformat.

将当前时间设置为NTP的时间类型,起始时间为1900年1月1号,只读模式

(3).w32tm/resync[/computer:

][/nowait][/rediscover][/soft] 

Tellacomputerthatitshouldresynchronizeitsclockassoon

aspossible,throwingoutallaccumulatederrorstatistics.

通知一台计算机,它需要立即同步时钟,显示各种各样的错误统计。

  computer:

-computerthatshouldresync.Ifnot

  specified,thelocalcomputerwillresync.

  计算机名称,如果不指定,表示本地计算机需要同步。

  nowait-donotwaitfortheresynctooccur;

  returnimmediately.Otherwise,waitfortheresyncto

  completebeforereturning.

无需等待,立即返回,否则需要完成同步后,才可以进入下一个等待命令

  rediscover-redetectthenetworkconfigurationandrediscover

  networksources,thenresynchronize.

是否需要检测网络配置和网络类型,然后再同步

  soft-resyncutilizingexistingerrorstatistics.Notuseful,

  providedforcompatibility.  软同步,如果同步有误,则提供兼容性。

(4)w32tm/stripchart/computer:

[/period:

]

  [/dataonly][/samples:

]

  Displayastrip_chartoftheoffsetbetweenthiscomputerand

  anothercomputer.

  以条形图的形式显示出当前计算机与另一台计算机之间的时间差异值

  computer:

-thecomputertomeasuretheoffsetagainst.

  目标计算机

  period:

-thetimebetweensamples,inseconds.The

  defaultis2s

2个实例之间的间隔时间,默认是2秒

  dataonly-displayonlythedata,nographics.

  只显示数据,没有图形

  samples:

-collectsamples,thenstop.Ifnot

  specified,sampleswillbecollecteduntilCtrl-Cispressed.

指定实例的个数,如果没有指定需要用Ctrl—C停止

注意:

这里指定的计算机不能是普通计算机,必须是时间服务器(SNTP源),这个命令本质就是查看当前客户源与一个SNTP(时间源)服务器的时间差。

如果是普通计算机会出现_____0x800705B4错误,截图如下:

采用正确的时间源进行比较,截图如下:

(5).w32tm/config[/computer:

][/update]

  [/manualpeerlist:

][/syncfromflags:

]

  [/LocalClockDispersion:

]

  computer:

-adjuststheconfigurationof.Ifnot

  specified,thedefaultisthelocalcomputer.

  指定需要调整的目标计算机,默认为本地

  _update-notifiesthetimeservicethattheconfigurationhas

  changed,causingthechangestotakeeffect

通知timeservice服务,配置信息已经发生变化,需要让变化生效。

  manualpeerlist:

-setsthemanualpeerlistto,

  whichisaspace-delimitedlistofDNSand/orIPaddresses.

  Whenspecifyingmultiplepeers,thisswitchmustbeenclosedin

  quotes.

  设定手动管道列表,多个DNS和IP地址用空格分开。

  syncfromflags:

-setswhatsourcestheNTPclientshould

  syncfrom.shouldbeacommaseparatedlistof

  thesekeywords(notcasesensitive):

    MANUAL-includepeersfromthemanualpeerlist

    DOMHIER-syncfromaDCinthedomainhierarchy

(6).w32tm/tz

  Displaythecurrenttimezonesettings.

显示当前时区设置

(7).w32tm/dumpreg[/subkey:

][/computer:

]

  Displaythevaluesassociatedwithagivenregistrykey.

显示指定注册表的值

  ThedefaultkeyisHKLM\System\CurrentControlSet\Services\W32Time

  (therootkeyforthetimeservice).

  subkey:

-displaysthevaluesassociatedwithsubkeyofthedefaultkey.

  computer:

-queriesregistrysettingsforcomputer

显示写在注册表中的值,默认位置为HKLM\System\CurrentControlSet\Services\W32Time

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 小学教育 > 语文

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1