1. Select one of the servers as the benchmark server, which provides the clock service.
(1) First determine if NTP exists, and if it does not exist, install it by using the following command:
Yum Install NTP
(2) Modify the configuration file/etc/ntp.conf in which to insert:
Restrict 192.168.20.0 mask 255.255.255.0 nomodify notrap
which
With restrict control authority
Nomodify-The client cannot change the time parameters of the NTP server
Noquery-The client cannot use commands such as NTPQ,NTPC to query the NTP server
Notrap-No trap remote login available
(3) The time service can be provided to the 192.168.20.0/24 machine at this point, and the NTP service is enabled:
/ETC/INIT.D/NTP Start //Start NTP service
Chkconfig ntpd on //Let NTP service boot up
(4) Check if the NTP port is turned on:
Netstat-unlnp
If normal, you should see that port 123 is turned on.
2. Client synchronization (using NTPD service)
You can also use Ntpdate to sync manually, but I recommend using the NTPD service for automatic synchronization here.
(1) Modify the/etc/ntp.conf, insert inside:
Server 192.168.20.91
(2) Enable the NTPD service to start
Chkconfig ntpd on
(3) Start the client NTPD service
/ETC/INIT.D/NTPD start
5,9,14,19 * * */usr/sbin/ntpdate 192.168.18.2
Multi-server time synchronization Linux