All Products
Search
Document Center

:How to enable NTP for ECS instances with Windows operating system

Last Updated:Dec 29, 2020

Disclaimer: this article may contain information about third-party products. Such information is for reference only. Alibaba Cloud does not make any guarantee, express or implied, with respect to the performance and reliability of third-party products, as well as potential impacts of operations on the products.

 

Overview

This article describes how to enable NTP for ECS instances running Windows.

 

Detail

Alibaba Cloud reminds you that:

  • Before you perform operations that may cause risks, such as modifying instance configurations or data, we recommend that you check the disaster recovery and fault tolerance capabilities of the instances to ensure data security.
  • If you modify the configurations and data of instances including but not limited to ECS and RDS instances, we recommend that you create snapshots or enable RDS log backup.
  • If you have authorized or submitted security information such as the logon account and password in the Alibaba Cloud Management console, we recommend that you modify such information in a timely manner.

Network Time Protocol (NTP) ensures that the Time of your cloud server is synchronized with standard Time. By default, NTP is enabled on Windows instances, and the NTP server is configured by default based on the corresponding key value in the registry. However, sometimes NTP may be disabled, in this case, you can enable it again. To enable NTP, follow these steps:

Note: Currently, the default Time zone for Alibaba Cloud ECS instances in all regions is China Standard Time (CST).

  1. Connect to the Windows ECS instance.

  2. Open a command line dialog box, run the following command will start modify the value of the delayed-auto"
    sc config W32Time start=delayed-auto
  3. Run the following command to start the Time service:
    net start w32time
  4. Run the following command to modify the NTP configuration in the registry:
    reg add HKLM\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient /v SpecialPollInterval /t REG_DWORD /d 0x12c /f
  5. Run the following command to update the NTP service address:
    w32tm /config /manualpeerlist:"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" /syncfromflags:manual /reliable:yes  /update

 

Application scope

  • Elastic Compute Service