CentOS time server Construction

Source: Internet
Author: User
Recently, we often encounter some faults caused by synchronization of time on each server. Now we need to build a CentOS time server to adjust and upgrade the ntp time package. # The specific configuration of yum-yinstallntp has been modified, here, I will check the configuration file so that the logout is not displayed # grep-v ^ # etcntp. confrestrictdefaultkodnomodifyn

Recently, we often encounter some faults caused by synchronization of time between servers. Now we need to set up a CentOS time server to adjust it.

Update and install the ntp time package
# Yum-y install ntp
The specific configuration has been modified. Here I will check the configuration file so that the logout is not displayed.
#Grep-V "^ #">/etc/ntp. conf

ResTrIct default kod nomodify notrap nopeer noquery
Restrict-6 default kod nomodify notrap nopeer noquery

Restrict 127.0.0.1
Restrict 192.168.10.0 mask 255.255.255.0 # This line is newly added so that the address can use the time server, which is equivalent to acl control.
Restrict-6: 1

Server ntp. fudan.EdU.cn prefer # A new priority is added. prefer indicates priority.
Server 0.rhel.pool.ntp.org
Server 1.rhel.pool.ntp.org
Server 2.rhel.pool.ntp.org

Server 127.127.1.0 # local clock
Fudge 127.127.1.0 stratum 10

DriftFile/Var/lib/ntp/drift
Keys/etc/ntp/keys

Start the service

Service ntpd start

NetStat-Tlunp

Check whether the 123udp port is started. Now we can log on to the client machine for synchronization.


[Root @ localhost ~] # NtpDate192.168.10.231

16 Jun 18:25:53 ntpdate [10535]: stepTimeServer 192.168.10.231 offSet1538.540766 sec

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.