1. ntp (networktimeprotocol) is a network protocol used to synchronize computer clocks. it can synchronize time between computers and other servers or clock sources. Time information is transmitted over UDP port 123. 2. install the ntp service yum-yinstallntp // use the yum command to download the installation package from the Internet, provided that the host can be connected
1. ntp (network time protocol) is a network protocol used to synchronize computer clocks. it can synchronize time between computers and other servers or clock sources. Time information is transmitted over UDP port 123.
2. install the ntp service
Yum-y install ntp // use the yum command to download the installation package from the Internet, provided that the host can connect to the network.
Complete the download and installation!
3. restart the NTP service.
Reboot successful!
4. start the Ntp service and pause related commands.
Service ntpd start # start
Service ntpd stop # stop
Service ntpd restart # restart
Service ntpd reload # reload
Service ntpd starts # view the current startup status
5. set the ntp service running level
Chkconfig ntpd on # set it to run automatically when the system runtime level is 2, 3, 4, or 5
Chkconfig ntpd off # set to not run automatically when the system running level is 2, 3, 4, or 5
Chkconfig ntpd -- level 35 on # set it to automatic on 3 and 5
Chkconfg ntpd -- level 35 off # set to not run automatically when the system running level is 3 or 5
Use chkconfig ntpd-list to view the ntp service running level
6. use the ntsysv command to set the ntp service to automatically start at the next boot
Locate ntpd, press a space to set it to auto-start, and press the Tab key to select OK and press enter.
7. ntp service configuration
7.1 The Main configuration file of the ntp service is in/etc/ntp. conf
The third line rejects the NTP client's operations by default and enables the kod function.
Row 9 allows local users to perform operations
Specify the client in row 13th
Lines 2 and 20 specify the NTP server address of the Internet
If the first line cannot communicate with the upper-layer NTP server defined earlier in this line, the local time is used as the standard time.
Row 3 specifies the layer of the local NTP server
Line 3 specifies the NTP server log file location
7.2 modify the/etc/ntp/step-tickers file and add the following content (when the ntp service is started, it will automatically perform time calibration with the upper-layer ntp service recorded in the file)
7.3 modify the/etc/sysconfig/ntpd file and set SYNC_HWCLOCK = yes to allow the BIOS to synchronize time with the system.
7.4 restart the NTP server
7.4 run the ntpstat command to display the last synchronization time between the local machine and the NTP server on the upper layer.
NTP server for time verification in the first line
The second line shows the time difference between the local host and the upper-layer NTP server.
Row 3 next synchronization time
8. complete NTP server configuration