Cloud computing shared components - Time synchronization service NTP (2)

First, the standard time to explain

Earth is divided into twelve regional thing, a total of 24 time zones

Greenwich Mean Time as a global standard that is (GMT time), plus Eastern time zone to time zone Greenwich, while the West time zone was reduced.

Earth's orbit is not a perfect circle, plus the speed of rotation gradually decline, so there will be time errors in calculation time, is the most accurate use of "atomic oscillation cycle" calculated physical clock. This clock is referred to the standard time i.e. - Universal Coordinated Time (UTC)

UTC accuracy of doubt, the US NIST F-1 atomic clock 2000 will have one second errors only.

With the time of the error, some work is accurate, ie without the need for time to complete. However, some work must be precise so that time can accomplish a task.

Therefore sync with the demands of time. Currently in use is the Network Time Protocol agreement. That Network Time Protocol.

 

Two, ntp clock synchronization service

NTP work request
(1) the client random to the NTP server port (UDP: 123) sending time synchronization request
(2) NTP server receives a request issued will adjust the time
(. 3) NTP server NTP client receives after the message is to be adjusted, so that time synchronization

Time synchronization server has two ways: one-time synchronization (manual synchronization), by the automatic synchronization service.

1, a one-time synchronization time: ntpdate domain name or ip address of time server
  Ip address check who has access: HTTP: //www.ntp.org.cn/pool.php
  ntpdate 120.25.108.11 (select Ali cloud)

2, NTP server implementation

    (. 1) NTP server installation
             yum the install NTP -Y
 
    (2) Check the NTP profile exist
             ls -l /etc/ntp.conf

    program (. 3) NTP involved
            the ntpd
            the ntpdate
            tzdata -update

     (. 4) related to the time program
            DATE
            hwclock

     (5) NTP involved file

           

      (. 6) NTP service
           NTP service is a C / S architecture model, the upper layer is preferably a time when creating the local service server to provide synchronization services to synchronize the local time

           

ntp.conf description
     restrict access control to manage the NTP
     usage: restrict [ip] mask [netmask ] parameter

     

     

     NTP server for synchronizing an upper end disposed
     Usage: server [ip or hostname] [ prefer]

     

     

     

     Let the local ntpd and local hardware time synchronization
        vi /etc/ntp.conf:
        Server 127.127.1.0 # local Clock
        Fudge 127.127.1.0 a Stratum 10


        systemctl start ntpd

     (7)Linux 客户端同步
          1) 手动同步
              ntpdate 192.168.1.100
          2) 配置文件
              vim /etc/ntp.conf
              server 192.168.1.100

              systemctl start ntpd
  

     (8)查看上层 NTP 服务状态
              ntpq –p

             

 

Guess you like

Origin www.cnblogs.com/Super-It/p/11240187.html