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
- Log in to the edge node.
- Run the following command to open the ntp.conf file:
vim /etc/ntp.conf
- 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
- 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.
- 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.
- Set the NTP service to run automatically during system startup:
SUSE OS:
chkconfig ntp on
CentOS:
chkconfig ntpd on
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot