Multi-server time synchronization Linux

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.