ntp network time server (network clock synchronization) client and server side settings Method Description
For more information refer to - Anhui Beijing quasi --ahjzsz.COM
in order to allow the timestamp on the file is consistent, we need the server ntp time synchronization.
ntp server partition on the server side and the client (CS)
Procedure
1 Preparation
two nodes need to be performed
to first install ntp
yum install ntp
After installation, start the service
systemctl start ntpd.service
set the boot from the start
systemctl enable ntpd.service
server side settings:
ntp server set up
the first server 192.168.0.104, as ntpserver, he set to synchronize external network time (ntpd service is turned on by default sync).
But it has to be provided to allow the network segment connected to it, as the time synchronization server within the network, a simple configuration is needed.
/Etc/ntp.conf modify and add the following information, represented by segment 210 to allow the synchronization server
/etc/ntp.conf vim
the restrict 192.168.0.0 mask 255.255.255.0 # add this line
After setting, restart the ntpd service, with ntpstat to check the effect [probably a few seconds to see the results]
the restart the ntpd systemctl
ntpstat
NTP client settings
192.168.0.107 as NtpClient, he set to synchronize NtpServer above, also requires a simple configuration, are made as follows on two nodes!
/Etc/ntp.conf modify the file, comment out the external network time server, you can add the local server
/etc/ntp.conf vim
Server 192.168.0.104 # add this line
server 0.centos.pool.ntp.org iburst # following four lines commented
Server 1.centos.pool.ntp.org iBurst
Server 2.centos.pool.ntp.org iBurst
Server 3.centos.pool.ntp.org iBurst
after setting, restart the ntpd service, with ntpstat to check the effect [to wait about fifteen minutes to see the effect]
systemctl restart ntpd
ntpstat
Author: Firetheworld
link: https: //www.jianshu.com/p/594a02194034
Source: Jane books
are copyrighted by the author. Commercial reprint please contact the author authorized, non-commercial reprint please indicate the source.