chrony软件使用说明

chrony软件使用说明

1chrony简介

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

  让时间保持精确。

  它由两个程序组成:chrongdchronyc

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

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

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

2chrony的操作

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

#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

   
   

猜你喜欢

转载自www.cnblogs.com/linux-org/p/11834141.html