This article describes how to configure time synchronization on a CentOS 7.4 server. Share with you for your reference, the details are as follows: 1. Install NTP server using yum #yum -y install ntp 2. Start the ntp service #systemctl start ntpd 3. Set the system to start automatically #systemctl enable ntpd 4. Modify the startup parameters and add -g -x parameters to allow the ntp service to work normally even when the system time error is large #vi /etc/sysconfig/ntpd OPTIONS="-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 the server time. If it is still out of sync, manually sync the server time. #/usr/sbin/ntpdate ntp.api.bz The error "the NTP socket is in use, exiting" appears. 9. The reason for this error is that the system ntpd server is running. By checking with ps aux | grep ntpd, you can see that ntpd is running. Solution: #systemctl stop ntpd #/usr/sbin/ntpdate ntp.api.bz 10. Last viewed time #timedatectl I hope this article will help you configure your CentOS server. You may also be interested in:
|
<<: Detailed explanation of the usage of two types of temporary tables in MySQL
>>: Vue.js Textbox with Dropdown component
Today, when I searched for a page on Baidu, becaus...
Syn attack is the most common and most easily exp...
count script #!/bin/sh numOfArgs=$# if [ $numOfAr...
Get the mongo image sudo docker pull mongo Run th...
Using DOSBox, you can simulate DOS under Windows ...
1. Use the SELECT clause to query multiple tables...
The event scheduler in MySQL, EVENT, is also call...
Preface In the Linux operating system, device fil...
Install PostgreSQL 11 on CentOS 7 PostgreSQL: The...
Common points: The DIV tag and SPAN tag treat som...
The machines in our LAN can access the external n...
Table of contents 01 What is the essence of a con...
Table of contents Overview What are callbacks or ...
Table of contents Docker deployment Always on clu...
Recently, a friend asked me a question: When layo...