Chrony服务部署

1.题目要求

chrony服务部署:两台机器

a: 第一台机器从阿里云同步时间

第二台机器从第一台机器同步时间

b: 第一台服务器使用系统时间作为第二台服务器的时钟源, 第一台服务器层级设置为6

2.内容

a:

第一台机子:

查看ip:

[root@hezhihao ~]# ifconfig

设置selinux:

[root@hezhihao ~]# setenforce 0

[root@hezhihao ~]# getenforce

Permissive

关闭防火墙:

[root@hezhihao ~]# systemctl stop firewalld

查看状态:

[root@hezhihao ~]# systemctl status firewalld

[root@hezhihao ~]# systemctl status chronyd

在/etc/chrony.conf配置阿里云

[root@hezhihao ~]# vim /etc/chrony.conf

server ntp.aliyun.com iburst,原先里边的pool使用#注释掉

allow:默认情况下不允许任何ntp客户端访问,将allow前面的#注释掉

配置完重启服务

[root@hezhihao ~]# systemctl restart chronyd

测试阿里云,确保链路链路通

[root@hezhihao ~]# ping ntp.aliyun.com

开启网络时间同步

timedatectl set-ntp true

[root@hezhihao ~]# timedatectl set-ntp true

使用timedatectl

使用chronyc sources

使用chronyc tracking

[root@hezhihao ~]# chronyc tracking

第二台机子:

[root@hezhihao1 ~]# systemctl disable firewall

[root@hezhihao1 ~]# systemctl status chronyd

[root@hezhihao1 ~]# vim /etc/chrony.conf

[root@hezhihao1 ~]# systemctl restart chronyd

b:

第一台机子:

配置server ip

配置层数stratum

local stratum 10: 1-15-> 只是表达了距离真正时钟源比较源

[root@hezhihao ~]# systemctl restart chronyd

[root@hezhihao ~]# timedatectl set-ntp true

[root@hezhihao ~]# timedatectl status

在第二台机子查看:

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Believe(@.@)

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值