开启 Windows 实例 NTP 服务

  • A+
所属分类:Windows
高性能企业级服务器首台5折

NTP(Network Time Protocol)服务能保证您的云服务器 ECS 的时间与标准时间同步。Windows 实例默认开启了 NTP 时钟服务,默认在注册表中相应键值中内置了 NTP 时钟服务器的配置,但有时 NTP 服务可能会被禁用,这种情况下,您可以开启 NTP 服务。

说明:目前,所有地域的阿里云 ECS 实例的默认时区为 CST(Central Standard Time)。

开启 NTP 服务的具体操作如下:

  1. 远程连接并登录到 Windows 实例。
  2. 打开命令行对话框,运行以下命令将 NTP 的配置修改为 delayed-auto。
    1. 1
      <span class="pln"> sc<span class="hljs-built_in"> config </span>W32Time start</span><span class="pun">=</span><span class="pln"> delayed</span><span class="pun">-</span><span class="kwd">auto</span>
  3. 运行以下命令启动 Windows 时间服务。
    1. 1
      <span class="pln"> <span class="hljs-built_in">net</span> <span class="hljs-built_in">start</span> w32time</span>
  4. 运行以下命令修改注册表中 NTP 配置。
    1. 1
      <span class="pln">reg add </span><span class="str">"HKLM<span class="hljs-symbol">\S</span>YSTEM<span class="hljs-symbol">\C</span>urrentControlSet<span class="hljs-symbol">\S</span>ervices<span class="hljs-symbol">\W</span>32Time<span class="hljs-symbol">\T</span>imeProviders<span class="hljs-symbol">\N</span>tpClient  /v  SpecialPollInterval /t REG_DWORD /d 0x12c /f"</span>
  5. 运行以下命令更新 NTP 服务的地址。
    1. 1
      <span class="pln">w32tm </span><span class="pun"><span class="hljs-built_in">/</span></span><span class="pln"><span class="hljs-built_in">config </span></span><span class="pun">/</span><span class="pln">manualpeerlist</span><span class="pun">:</span><span class="str"><span class="hljs-string">"ntp1.aliyun.com,0x1 ntp2.aliyun.com,0x1 ntp3.aliyun.com,0x1 ntp4.aliyun.com,0x1 ntp5.aliyun.com,0x1 ntp6.aliyun.com,0x1 ntp1.cloud.aliyuncs.com,0x1 ntp2.cloud.aliyuncs.com,0x1 ntp3.cloud.aliyuncs.com,0x1 ntp4.cloud.aliyuncs.com,0x1 ntp5.cloud.aliyuncs.com,0x1 ntp6.cloud.aliyuncs.com,0x1 ntp7.cloud.aliyuncs.com,0x1 ntp8.cloud.aliyuncs.com,0x1 ntp9.cloud.aliyuncs.com,0x1 ntp10.cloud.aliyuncs.com,0x1 ntp11.cloud.aliyuncs.com,0x1 ntp12.cloud.aliyuncs.com,0x1"</span></span> <span class="pun">/</span><span class="pln">syncfromflags</span><span class="pun">:</span><span class="pln">manual </span><span class="pun">/</span><span class="pln">reliable</span><span class="pun">:</span><span class="pln">yes  </span><span class="pun">/</span><span class="pln">update</span>

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: