chrony软件使用说明

chrony软件使用说明html

1chrony简介vim

  chrony是一个开源的自由软件,它能保持系统时钟与时间服务器(ntp)同步,centos

  让时间保持精确。服务器

  它由两个程序组成:chrongdchronycide

  chronyd是一个后台运行的守护进程,用于调整内核运行的系统时钟和时间服务器同步。ui

  它肯定计算机增减时间的比率,并对此进行补偿。spa

  chronyCentOs7.x上自带的时间同步软件orm

2chrony的操做server

#yum install -y chrony -->安装服务htm

#systemctl start chronyd.service -->启动服务

#systemctl enable chronyd.service -->设置开机自自动,默认是enable

3chrony配置文件

chrony服务使用的配置文件为/etc/chrony.conf

其配置内容格式和ntpd服务基本类似

[root@chrony ~]# vim /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.centos.pool.ntp.org iburst

#server 1.centos.pool.ntp.org iburst

#server 2.centos.pool.ntp.org iburst

#server 3.centos.pool.ntp.org iburst

 server ntp1.aliyun.com       iburst

# Record the rate at which the system clock gains/losses time.

driftfile /var/lib/chrony/drift

 

# Allow the system clock to be stepped in the first three updates

# if its offset is larger than 1 second.

makestep 1.0 3

 

# Enable kernel synchronization of the real-time clock (RTC).

rtcsync

 

# Enable hardware timestamping on all interfaces that support it.

#hwtimestamp *

 

# Increase the minimum number of selectable sources required to adjust

# the system clock.

#minsources 2

 

# Allow NTP client access from local network.

  allow 192.168.56.0/24

 

# Serve time even if not synchronized to a time source.

#local stratum 10

 

# Specify file containing keys for NTP authentication.

#keyfile /etc/chrony.keys

 

# Specify directory for log files.

logdir /var/log/chrony

 

# Select which information is logged.

#log measurements statistics tracking

相关文章
相关标签/搜索