Help Center/ Intelligent EdgeFabric/ FAQs/ Edge Node FAQs/ How Do I Synchronize Time with the NTP Server?
Updated on 2022-12-09 GMT+08:00

How Do I Synchronize Time with the NTP Server?

Background

If you use IEF to manage your edge node, ensure that the time of the edge node is consistent with the UTC time. Otherwise, the monitoring data and logs of the edge node may be inaccurate.

You can select a proper NTP server for time synchronization to ensure time consistency.

Prerequisites

Network Time Protocol daemon (ntpd) has been installed on the edge node.

For example, you can run the rpm -qa | grep ntp command on CentOS to check whether ntpd is installed. If version information similar to ntp-x.x.x.centos.x86_64 is displayed, ntpd has been installed. If no version information is displayed, run the yum -y install ntp command to install ntpd.

Procedure

  1. Log in to the edge node.
  2. Run the following command to open the ntp.conf file:

    vim /etc/ntp.conf

  3. Add the following statement to configure the NTP server:

    server Domain name of the NTP server

    For details about the NTP server domain name, see Does Huawei Cloud Provide the NTP Server and How Can I Install It?.

    Example:

    server ntp.myhuaweicloud.com

  4. Run either of the following command to start the NTP service:

    SUSE OS:

    service ntpd restart

    CentOS:

    systemctl restart ntpd

    Run the appropriate command based on the OS running on the edge node.

  5. Run the following command to check whether the time of the edge node is synchronized with that of the NTP server:

    ntpq -p

    If "*" is displayed, the time has been synchronized.

    It takes several minutes to perform NTP time synchronization for the first time.

  6. Set the NTP service to run automatically during system startup:

    SUSE OS:

    chkconfig ntp on

    CentOS:

    chkconfig ntpd on