zoukankan      html  css  js  c++  java
  • 配置时间服务器

    1.安装chrony

    yum -y install chronyd

    2.配置文件

    cat /etc/chrony.conf
    # Use public servers from the pool.ntp.org project.
    # Please consider joining the pool (http://www.pool.ntp.org/join.html).
    server 0.rhel.pool.ntp.org iburst
    server 1.rhel.pool.ntp.org iburst
    server 2.rhel.pool.ntp.org iburst
    server 3.rhel.pool.ntp.org iburst

    server 192.168.52.200 iburst

    # Ignore stratum in source selection.
    stratumweight 0

    # Record the rate at which the system clock gains/losses time.
    driftfile /var/lib/chrony/drift

    # Enable kernel RTC synchronization.
    rtcsync

    # In first three updates step the system clock instead of slew
    # if the adjustment is larger than 10 seconds.
    makestep 10 3

    # Allow NTP client access from local network.
    #allow 192.168/16

    # Listen for commands only on localhost.
    bindcmdaddress 127.0.0.1
    bindcmdaddress ::1

    # Serve time even if not synchronized to any NTP server.
    #local stratum 10

    keyfile /etc/chrony.keys

    # Specify the key used as password for chronyc.
    commandkey 1

    # Generate command key if missing.
    generatecommandkey

    # Disable logging of client accesses.
    noclientlog

    # Send a message to syslog if a clock adjustment is larger than 0.5 seconds.
    logchange 0.5

    logdir /var/log/chrony
    #log measurements statistics tracking

    3.启动服务

    systemctl start chronyd.service //启动服务

    4.查看时间同步源

    chronyc sources -v
    210 Number of sources = 0

    .-- 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
    || / xxxx = adjusted offset,
    || Log2(Polling interval) -. | yyyy = measured offset,
    || | zzzz = estimated error.
    || | |
    MS Name/IP address Stratum Poll Reach LastRx Last sample
    ===============================================================================

  • 相关阅读:
    web开发中禁止因为网速慢导致重复提交数据
    margin四个元素的顺序
    js阻止提交表单(post)
    js中DOM集合的动态特性
    js正则表达式中=s.g表示什么意思
    js去掉字符串前后空格的五种方法
    电脑结构和CPU、内存、硬盘三者之间的关系
    mysql——查询练习
    python基础知识14——I/O阻塞非阻塞,同步异步
    Redis主从数据库的安装及主从配置
  • 原文地址:https://www.cnblogs.com/ipanel/p/10973816.html
Copyright © 2011-2022 走看看