This article mainly introduces the relevant information of linux ntp server time synchronization settings. Friends who need it can refer to
linux ntp server time synchronization settings
Time The need for synchronization exists in many places. For example, if you install cm and cdh, you need ntp time synchronization, otherwise a red warning will appear
The main thing here is to set up a server as the main server and let other machines synchronize the time of this machine, and it is configured The local time is not synchronized with the internet time, because many times the server cannot connect to the Internet
First we set up 2 machines here, the main machine is 192.168.5.102, and the other one is 192.168.5.103
First set up the main machine
Edit the /etc/ntp.conf file
Add
## in it #
restrict 127.0.0.1 # 开启内部递归网络接口 lo restrict 192.168.5.0 mask 255.255.255.0 nomodify #在内部子网里面的客户端可以 进行网络校时,但不能修改NTP服务器的时间参数
server 127.127.1.0 fudge 127.127.1.0 stratun 10
service ntpd start
chkconfig ntpd on
is set as follows:
* * * * * root /usr/sbin/ntpdate 192.168.5.102;/sbin/hwclock -w
The above is the detailed content of Detailed explanation of how to synchronize and set the NTP server time in Linux. For more information, please follow other related articles on the PHP Chinese website!