The construction of NTP server in CentOS

Source: Internet
Author: User
Tags local time centos

Let's briefly introduce a few nouns

Atomic Clock: Now the most accurate calculation time is the physical clock (Atomic Clock) computed using the atomic oscillation cycle, which is also defined as the standard Time (International Atomic times)

UTC (Coordinated Universal Time): Concorde is the right time to define the benchmark using Atomic Clock

Hardware clock: Hardware clock refers to the special circuit embedded in the motherboard, its existence is usually we shut down after the machine can also calculate the reason for the time

System clock: The clock that the operating system kernel to compute the time. Its value from January 1, 1970 00:00:00 UTC time to the sum of seconds so far

Preparation before setting up an NTP service

1. Check the system time zone is correct

In China, the correct time zone should be the CST (Chinese Standard), which is what we usually call the Beijing period.

So the local time in China at 8 o'clock, we can have the following two ways to express

20:00 CST

12:00 UTC

Because China is in utc+8 time zone, and so on, in UTC Standard Time, it is 12:00.

Regardless of the time that we want to sync the system through any channel, the provider will usually give only the utc+0 time value and not the time zone (because it doesn't know where you are). So when we set the system time, it's the first thing to do

# date

Thu Oct 11:22:45 EDT 2013

If the time zone is found to be incorrect, the method of modification is shown in Appendix 1

2. Check that NTP is installed

# Rpm-qa |grep ^NTP

Ntp-4.2.4p8-3.el6.centos.x86_64

Ntpdate-4.2.4p8-3.el6.centos.x86_64

As shown above, it is correctly installed

3. Check if the upper NTP server is connected properly

Direct use of country-time servers

1.cn.pool.ntp.org

2.cn.pool.ntp.org

In order to prevent a server failure with upper-level alignment and to provide a proper time synchronization, it is generally recommended that you configure two or more time synchronization servers. Test the two clock service for normal use below

# ntpdate-q 1.cn.pool.ntp.org

Server 202.112.10.36, stratum 2, offset-1.883582, delay 0.18350

Server 202.112.29.82, stratum 2, offset-1.860654, delay 0.23692

Server 202.112.31.197, stratum 2, offset-1.812637, delay 0.13278

Server 218.75.4.130, stratum 2, offset-1.837221, delay 0.04099

OCT 09:07:03 ntpdate[1625]: Step time Server 218.75.4.130 offset-1.837221 sec

# ntpdate-q 2.cn.pool.ntp.org

Server 202.112.10.36, stratum 2, offset-1.834295, delay 0.07317

Server 202.112.29.82, stratum 2, offset-1.810122, delay 0.12784

Server 202.112.31.197, stratum 2, offset-1.838527, delay 0.07227

Server 218.75.4.130, stratum 2, offset-1.833332, delay 0.04346

OCT 09:12:36 ntpdate[22558]: Step time Server 218.75.4.130 offset-1.833332 sec

As shown above, is normal, if the upper server is not available, generally shown below

Server 10.32.196.60, stratum 0, offset 0.000000, delay 0.00000

-Oct 15:01:17 ntpdate[23338]: No server suitable for synchronization found

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.