Linux NTP Server Setup

Source: Internet
Author: User

Linux Time synchronization Server Setup

NTP(Network Time Protocol) is used to make the computerTime Synchronizationudp protocol 123 The port provides services externally, it can make the computer to its server or clock source (such as quartz clock, to do time synchronization, it can provide high accuracy time correction (lan is less than the standard difference between 1 milliseconds, wan on dozens of milliseconds), and can be referred to as cryptographic acknowledgments to prevent malicious protocol attacks. Time Press NTP the level of the server is propagated. According to the external UTC source of the proximity of all the servers into different stratum (layer).

to do a project today you need to configure a NTP time synchronization server as a timing server for other application systems. The environment used is the CentOS 6.5, which is doneusing its own NTP service.

First, installation NTP Service

[[email protected] ~]# Rpm-qa|grep NTP

Ntpdate-4.2.6p5-1.el6.centos.x86_64

Ntp-4.2.6p5-1.el6.centos.x86_64

Fontpackages-filesystem-1.41-1.1.el6.noarch

Use the RPM tool to query, if there are three packages above, the system has installed NTP Service, if not, mount the installation image and install it using the command below

[[Email protected] ~] #rpm –IVH ntp-4.2.6p5-1.el6.centos.x86_64

[[Email protected] ~] #rpm –IVH ntpdate-4.2.6p5-1.el6.centos.x86_64

or configure yum to install

[[Email protected] ~] #yum Install NTP

Second, the configuration NTP Server configuration file

( 1 ) Edit the configuration file /etc/ntp.conf file

#restrict192.168.1.0 Mask 255.255.255.0 nomodify notrap

// Locate the above configuration and remove the previous # Modify the address range to allow access NTP address of the service, for example

restrict192.168.30.0 Mask 255.255.255.0 nomodify notrap

// in this example, the range of addresses allowed to receive synchronization requests is 192.168.30.0/24

( 2 ) Configure the upstream NTP Server

Configure upstream NTP server, first check that the upstream server is connected properly. If available, modify the NTP configuration file as follows:

Server 210.72.145.44 #China Time Center

Server cn.pool.ntp.org #Pulbic Time server

Server 202.112.10.36

Server 127.127.1.0 # Local clock

Fudge 127.127.1.0 Stratum 10

// If the second step is configured Server 210.72.145.44 , cn.pool.ntp.org is not valid, the NTP Depending on the configuration here, the server will make its own time as NTP server time, that is, synchronize with yourself.

( 3 ) configuration NTP service startup

[[Email protected] ~] #chkconfig ntpd on

[Email protected] ~]# Chkconfig--list | grep ntpd

NTPD 0:off 1:off 2:on 3:on 4:on 5:on 6:off

Ntpdate 0:off 1:off 2:off 3:off 4:off 5:off 6:off

// Configuration NTP service is powered on from boot

[[Email protected] ~] #service ntpd Restart

Shutting downntpd: [OK]

STARTINGNTPD: [OK]

// Restart NTP Service

[[Email protected] ~] #service ntpd Status

NTPD (PID 2027) is running ...

// Check NTP whether the service is running properly

[[Email protected] ~] #iptables –f

// shutting down the firewall

( 4 ) Test NTP Service

after startup, it is generally necessary 5-10 minutes to start syncing time with the external time server. You can query NTPD Service conditions by command.

[[Email protected] ~] #ntpq-P

Remote refID St T when poll reach delay offset jitter

==============================================================================

210.72.145.44.          Init. u-64 0 0.000 0.000 0.000

85.199.214.101.          Init. u-64 0 0.000 0.000 0.000

202.112.10.36.          Init. u-64 0 0.000 0.000 0.000

*local (0).          Locl. Ten L 20 64 77 0.000 0.000 0.000

// Check the connection to the upstream server.

Find a host to test within the range of addresses that allow the time synchronization service to be used

[Email protected]~]# ntpdate 192.168.100.100

18:07:50NTPDATE[15670]: Adjust time server 192.168.100.100 offset 0.444003 sec

// on the host 192.168.30.100 used on ntpdate command for TIME synchronization

synchronization is successful, NTP Server Setup is complete.


This article is from the "Dragonli" blog, make sure to keep this source http://77418.blog.51cto.com/67418/1930472

Linux NTP Server Setup

Related Article

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.