zoukankan      html  css  js  c++  java
  • Centos 7/8 Chronyd时间同步

    Chronyd

    chronyd是一个同步系统时钟的守护进程。

    从Centos7开始默认安装时钟同步服务chronyd,而不是ntpd。

    # dnf -y install chronyd
    # eccho 'server ntp1.aliyun.com iburst' >> /etc/chrony.conf
    # systemctl enable chronyd.service && systemctl start chronyd.service

    Chronyc

    chronyc is a command-line interface program which can be used to monitor chronyd’s performance and to change various operating parameters whilst it is running.

    # chronyc sources -v
      .-- Source mode  '^' = server, '=' = peer, '#' = local clock.
     / .- Source state '*' = current synced, '+' = combined , '-' = not combined,
    | /   '?' = unreachable, 'x' = time may be in error, '~' = time too variable.
    ||                                                 .- xxxx [ yyyy ] +/- zzzz
    ||      Reachability register (octal) -.           |  xxxx = adjusted offset,
    ||      Log2(Polling interval) --.      |          |  yyyy = measured offset,
    ||                                     |          |  zzzz = estimated error.
    ||                                 |    |           
    MS Name/IP address         Stratum Poll Reach LastRx Last sample               
    ===============================================================================
    ^* classroom.example.com         8  10   377  1000   +130us[ +147us] +/-  819us

    Timedatectl

    Query or change system time and date settings.

    set-timezone

      设置时区,也可以手动执行localtime软连接

      # timedatectl set-timezone Asia/Shanghai
      # ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

    set-ntp BOOL

      和chrony配置的ntp server进行时间同步

    set-time TIME

      手动设置日期时间

     

  • 相关阅读:
    UVa 12174 (滑动窗口) Shuffle
    UVa 1607 (二分) Gates
    CodeForces ZeptoLab Code Rush 2015
    HDU 1525 (博弈) Euclid's Game
    HDU 2147 (博弈) kiki's game
    UVa 11093 Just Finish it up
    UVa 10954 (Huffman 优先队列) Add All
    CodeForces Round #298 Div.2
    UVa 12627 (递归 计数 找规律) Erratic Expansion
    UVa 714 (二分) Copying Books
  • 原文地址:https://www.cnblogs.com/vincenshen/p/12441451.html
Copyright © 2011-2022 走看看