当前位置:网站首页>NTP synchronization clock server server and client settings

NTP synchronization clock server server and client settings

2022-06-24 02:02:00 NTP network synchronization clock

To keep the timestamp on the file consistent , We need to do the server ntp Time synchronization .

ntp The server is divided into server and client (C-S)

Operation steps

1 preparation

Both nodes need to perform

First installation ntp

yum install ntp

After installation , Start the service

systemctl start ntpd.service

Set power on self start

systemctl enable ntpd.service

Server settings :

ntp Server settings

First server 192.168.0.104, As ntpserver, Set it to synchronize the Internet time (ntpd When the service is enabled, it is synchronized by default ).

But you have to set up an intranet segment to connect to it , Use it as the time synchronization server of the intranet , So you need a simple configuration .

modify /etc/ntp.conf file , Add the following information , It means to allow 210 Network segment to synchronize this server

vim /etc/ntp.conf

restrict 192.168.0.0 mask 255.255.255.0 # Add this line

After setting , restart ntpd service , use ntpstat To check the effect 【 You can see the effect in a few seconds 】

systemctl restart ntpd

ntpstat

ntp Client side Settings

192.168.0.107 As ntpclient, Set it to synchronize the above ntpserver, A simple configuration is also required , Make the following configurations on the two nodes !

modify /etc/ntp.conf file , Comment out the Internet time server , Add a local server

vim /etc/ntp.conf

server 192.168.0.104 # Add this line

server 0.centos.pool.ntp.org iburst # The following four lines are commented out

server 1.centos.pool.ntp.org iburst

server 2.centos.pool.ntp.org iburst

server 3.centos.pool.ntp.org iburst

After setting , restart ntpd service , use ntpstat To check the effect 【 It will take about fifteen minutes , See the effect 】

systemctl restart ntpd

ntpstat

author :Firetheworld

link :https://www.jianshu.com/p/594a02194034

source : Simple books

The copyright belongs to the author . Commercial reprint please contact the author for authorization , Non-commercial reprint please indicate the source .

原网站

版权声明
本文为[NTP network synchronization clock]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/11/20211108165436239T.html