Linux using NTP service management /synchronization server time

  

When there are multiple Web Servers, and the time of each server needs to be consistent, then you can consider using the NTP service.

1. First use ntpstat to check the current status of the NTP service. #ntpstat If the following content is output, it means that it has not been started yet. You need to set the NTP service to start when the server is restarted: Unable to talk to NTP daemon. Is it running? If the output below is already working: synchronised to NTP server (198.55. 111.5) at stratum 3time correct to within 238 mspolling server every 64 s If the output: unsynchronised, you need to restart (ntpd restart) to synchronize.

2.Use ntpq -p to view NTP server list

#ntpq -premote refid st t when poll reach delay offset jitter=============== ===========================================================
======== .sjtu.edu.cn .STEP. 16 u - 64 0 0.000 0.000 0.000

3. Manual synchronization time #ntpdate If the following content is output, the ntp service has been started, causing the manual synchronization time to fail. You need to stop ntp first. Service: the NTP socket is in use. exiting#service ntpd stop#ntpdate cn.pool.ntp.org If the following content is output, the manual synchronization time is successful: adjust time server xxx Finally remember to start the ntp service and let him update automatically.

4.Start NTP service#service ntpd startStarting ntpd: [ OK ] Enable NTP to start at boot time with the chkconfig command.

5.Enable NTP self-start #chkconfig ntpd onVerify that NTP Is enabled with the following command.

6. Check NTP self-starting condition #chkconfig --list ntpdntpd 0:off 1:off 2:on 3:on 4:on 5:on 6:offHere ntpd is on In runlevels 2, 3, 4, and 5, which is correct.

Copyright © Windows knowledge All Rights Reserved