NTP server Construction

Source: Internet
Author: User


NTP server Construction
NTP is a time server that provides the Synchronization Update time of other computers, so that the time of each computer is the same, without any deviation due to the long running of the system. The client also needs to install the NTP service.
1. Install NTP,
[[Email protected] ~] # Yum-y install NTP
2. Modify the master configuration file. By default, all users are rejected for synchronization. Add a rule to allow synchronization of 192.168.10.0 network segments.

[[Email protected] ~] # Vim/etc/NTP. conf
[[Email protected] ~~] # Grep-ve "^ # | ^ $"/etc/NTP. conf
Driftfile/var/lib/NTP/drift // The frequency error of the Upper-layer NTP server is recorded in this file

Restrict default Kod nomodify notrap nopeer noquery // disable all Address Synchronization times, modify, View
Restrict-6 default Kod nomodify notrap nopeer noquery // disable synchronization time of all IPv6 addresses, modify, View
Restrict 192.168.100.0 mask 255.255.255.0 nomodify // Add the allowed 192.168.100.0 network segment synchronization time
Restrict 127.0.0.1
Restrict-6: 1
Server 0.rhel.pool.ntp.org // specifies the NTP server for time verification. The priority is from top to bottom.
Server 1.rhel.pool.ntp.org
Server 2.rhel.pool.ntp.org
Includefile/etc/NTP/crypto/PW
Keys/etc/NTP/keys

 

3. Start the service

[[Email protected] ~] # Service ntpd restart
[[Email protected] ~] # Chkconfig ntpd on

4. Verification

Server Port

[[Email protected] ~] # Netstat-Aun | grep: 123

UDP 0 0 192.168.10.254: 123

Client

Ntpdate 192.168.10.254 synchronization between customers and servers

 
5. automatically update and add to the scheduled task.

[[Email protected] ~] # Crontab-e
0 10 ***/sbin/ntpdate 192.168.10.254
0 10 ***/sbin/hwclock -- systohc
[[Email protected] ~] # Service crond restart
[[Email protected] ~] # Chkconfig crond on

Ntpstat displays the strong state of the NTP server
Enable standard NTP query for NTQ
Ntpdate indicates the server for immediate update
Note: manual update of ntpdate and automatic update of NTP service cannot be used at the same time

 

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.