Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Centos 7.4 server time synchronization configuration method [based on NTP service]

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This paper gives an example to describe the time synchronization configuration method of Centos 7.4 server. Share with you for your reference, the details are as follows:

1. Yum install NTP server

# yum-y install ntp

two。 Start the ntp service

# systemctl start ntpd

3. Set boot self-boot

# systemctl enable ntpd

4. Modify the startup parameters and add the-g-x parameter to allow the ntp service to work properly even when the system time error is large.

# vi / etc/sysconfig/ntpdOPTIONS= "- g-x"

5. Read the current time

# timedatectl

6. Set the time zone to Asia / Shanghai

# timedatectl set-timezone Asia/Shanghai

7. Enable NTP server synchronization

# timedatectl set-ntp yes

8. Check server time if it is still out of sync, manually synchronize server time

# / usr/sbin/ntpdate ntp.api.bz

"the NTP socket is in use, exiting" error occurred.

8 Nov 09:57:02 ntpdate [4726]: the NTP socket is in use, exiting

9. The reason for this error is that the system ntpd server is running. If you view it through ps aux | grep ntpd, you will see that ntpd is running.

Solution:

# systemctl stop ntpd # / usr/sbin/ntpdate ntp.api.bz

10. Last check time

# timedatectl

I hope what is described in this article will be helpful to the configuration of CentOS server.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report