【Linux】【Services】【SaaS】Docker+kubernetes(2. 配置NTP服务chrony)

1. 简介

1.1. 这次使用另外一个轻量级的NTP服务,chrony。这是openstack推荐使用的ntp服务。

1.2. 官方网站:https://chrony.tuxfamily.org/

2. 环境

2.1. chrony:3.1-2.el7

3. 安装

3.1. 在所有机器上安装chrony

yum install chrony

4. 配置

4.1. 在10.30.2.81/82上配置服务端,/etc/chrony.conf

# Allow NTP client access from local network.
allow 172.16.0.0/24

4.2. 在其他机器上配置客户端,/etc/chrony.con

server 172.16.0.81 iburst
server 172.16.0.82 iburst

如果使用ansible机器,也可以使用命令替换

sed -e '3,6s/^/#/g' -e '7iserver 172.16.0.81 iburst\nserver 172.16.0.82 iburst' /etc/chrony.conf

4.3. 启动服务,并设置开机启动

systemctl start chronyd && systemctl enable chronyd

4.4. 测试下连通性

[root@hctjosinfra01 named]# chronyc sources
210 Number of sources = 4
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^- ntp1.ams1.nl.leaseweb.net     2  10   377   237   +484us[ +484us] +/-  279ms
^* news.neu.edu.cn               2  10   377   69m    -99us[ -113us] +/- 8995us
^- 85.254.217.235                2  10   337   274    +18ms[  +18ms] +/-  221ms
^- ntp7.flashdance.cx            2  10   377   680  +1681us[+1681us] +/-  151ms
[root@hctjosetcd01 ~]# chronyc sources
210 Number of sources = 2
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^- 172.16.0.81                   3   6    17    14   +219us[ +219us] +/-   12ms
^* 172.16.0.82                   3   6    17    15   +773ns[  -47us] +/- 9668us

 

posted @ 2018-01-04 10:28  炼狱腾蛇  阅读(249)  评论(0编辑  收藏  举报