第 16 章 Synchronizes system time using the Network Time Protocol (NTP)

简介:

目录

16.1. ntpd - Network Time Protocol (NTP) daemon
16.2. ntp client

http://www.ntp.org

16.1. ntpd - Network Time Protocol (NTP) daemon

过程 16.1. ntp server

  1. # yum install ntp	
    				
  2. port

    [root@ntp ~]# netstat -unlnp |grep 123
    udp        0      0 192.168.5.5:123             0.0.0.0:*                               10810/ntpd
    udp        0      0 172.16.0.5:123              0.0.0.0:*                               10810/ntpd
    udp        0      0 192.168.3.5:123             0.0.0.0:*                               10810/ntpd
    udp        0      0 127.0.0.1:123               0.0.0.0:*                               10810/ntpd
    udp        0      0 0.0.0.0:123                 0.0.0.0:*                               10810/ntpd
    udp        0      0 ::1:123                     :::*                                    10810/ntpd
    udp        0      0 fe80::225:64ff:fe9a:123     :::*                                    10810/ntpd
    udp        0      0 :::123                      :::*                                    10810/ntpd
    
    [root@ntp ~]# lsof -i :123
    COMMAND   PID USER   FD   TYPE DEVICE SIZE NODE NAME
    ntpd    10810  ntp   16u  IPv4  35921       UDP *:ntp
    ntpd    10810  ntp   17u  IPv6  35922       UDP *:ntp
    ntpd    10810  ntp   18u  IPv6  35923       UDP [fe80::225:64ff:fe9a:d7e0]:ntp
    ntpd    10810  ntp   19u  IPv6  35924       UDP localhost6.localdomain6:ntp
    ntpd    10810  ntp   20u  IPv4  35925       UDP localhost.localdomain:ntp
    ntpd    10810  ntp   21u  IPv4  35926       UDP nis.example.com:ntp
    ntpd    10810  ntp   22u  IPv4  35927       UDP 172.16.0.5:ntp
    ntpd    10810  ntp   23u  IPv4  35928       UDP 192.168.5.5:ntp
    				
  3. status

    ntpstat

    [root@subversion ~]# ntpstat
    synchronised to local net at stratum 11
       time correct to within 11 ms
       polling server every 1024 s
    				
    [root@subversion ~]# ntptrace -n 127.0.0.1
    127.0.0.1: stratum 11, offset 0.000000, synch distance 0.010984
    				
    [root@subversion ~]# ntpq -p
         remote           refid      st t when poll reach   delay   offset  jitter
    ==============================================================================
     122.226.192.4   .INIT.          16 u    - 1024    0    0.000    0.000   0.000
     218.75.4.130    .INIT.          16 u    - 1024    0    0.000    0.000   0.000
     www.chinaepg.ne .INIT.          16 u    - 1024    0    0.000    0.000   0.000
    *LOCAL(0)        .LOCL.          10 l   60   64  377    0.000    0.000   0.001
    				
  4. http://www.pool.ntp.org/

    vim /etc/ntp.conf
    server 2.cn.pool.ntp.org
    server 3.asia.pool.ntp.org
    server 2.asia.pool.ntp.org
    				
  5. # chkconfig ntpd on
    # service ntpd start/stop/restart
    				

Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a>comments powered by Disqus





原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

目录
相关文章
|
21天前
|
Java 数据库连接 数据库
The server time zone value ‘Öйú±ê׼ʱ¼ä‘ is unrecognized or represents more than one time zone
The server time zone value ‘Öйú±ê׼ʱ¼ä‘ is unrecognized or represents more than one time zone
14 0
|
8月前
|
Java 关系型数据库 MySQL
The server time zone value ‘?й???’ is unrecognized or represents more than one time zone. You must c
报错信息如下:The server time zone value ‘?й???’ is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
51 0
|
4月前
|
数据库连接
数据库连接的时区问题 The server time zone value is unrecognized
数据库连接的时区问题 The server time zone value is unrecognized
22 0
|
9月前
|
关系型数据库 MySQL Java
超详解The server time zone value ‘�й���׼ʱ��‘ is unrecognized or represents more than one time zone
超详解The server time zone value ‘�й���׼ʱ��‘ is unrecognized or represents more than one time zone
121 0
|
11月前
|
数据库连接 数据库
The server time zone value ‘‘ is unrecognized or represents more than one time zone.
The server time zone value ‘‘ is unrecognized or represents more than one time zone.
|
关系型数据库 MySQL Java
The server time zone value '?й???????' is unrecognized or represents more than one time zone.
The server time zone value '?й???????' is unrecognized or represents more than one time zone.
63 0
The server time zone value '?й???????' is unrecognized or represents more than one time zone.
|
关系型数据库 MySQL Java
The server time zone value ‘锟叫癸拷锟斤拷\u05FC时锟斤拷‘ is unrecognized or represents more than one time zone
The server time zone value ‘锟叫癸拷锟斤拷\u05FC时锟斤拷‘ is unrecognized or represents more than one time zone
The server time zone value ‘锟叫癸拷锟斤拷\u05FC时锟斤拷‘ is unrecognized or represents more than one time zone
|
Java 数据库连接 数据库
The sever time reprents more than one tie zoe.
The sever time reprents more than one tie zoe.
91 0
|
Java 数据库连接
JDBC - The server time zone value ‘???‘ is unrecognized or represents more than one time zone
JDBC - The server time zone value ‘???‘ is unrecognized or represents more than one time zone
73 0