chrony时间同步 服务端 客户端 安装配置
#!/bin/sh#运行环境 centos7#chrony时间同步 服务端 客户端 安装配置#安装yum install chrony -ycp /etc/chrony.conf{,.bak} #备份默认配置#chrony服务配置echo "# #外部NTP服务#server ntp6.aliyun.com iburstserver cn.ntp.org.cn iburstserver ntp.shu.edu.cn iburstdriftfile /var/lib/chrony/driftdriftfile /var/lib/chrony/driftmakestep 1.0 3rtcsynclogdir /var/log/chrony">/etc/chrony.conf#chrony作为内网NTP服务配置echo "# #外部NTP服务server ntp6.aliyun.com iburstserver cn.ntp.org.cn iburstserver ntp.shu.edu.cn iburstdriftfile /var/lib/chrony/driftmakestep 1.0 3rtcsync# #内网allow 10.2.1.0/24allow 172.16.11.0/24bindcmdaddress 127.0.0.1bindcmdaddress ::1keyfile /etc/chrony.keyscommandkey 1generatecommandkeynoclientloglogchange 0.5logdir /var/log/chrony">/etc/chrony.conf#chrony使用内网NTP服务配置echo "# #内部NTP服务server 10.2.1.10 iburstserver ntp6.aliyun.com iburstdriftfile /var/lib/chrony/driftmakestep 1.0 3rtcsynclogdir /var/log/chrony">/etc/chrony.conf#启动systemctl start chronydsystemctl enable chronyd #开机启动systemctl restart chronydchronyc sources #查看同步源##查看chronyc sources #服务端# 210 Number of sources = 3# MS Name/IP address Stratum Poll Reach LastRx Last sample # ===============================================================================# ^* time6.aliyun.com 2 6 377 71 -2307us[-3126us] +/- 20ms# ^+ xk-6-95-a8.bta.net.cn 2 6 377 7 +767us[ +767us] +/- 62ms# ^- ntp.shu.edu.cn 2 6 377 7 -11ms[ -11ms] +/- 419ms# # chronyc sources #客户端# 210 Number of sources = 1# MS Name/IP address Stratum Poll Reach LastRx Last sample # ===============================================================================# ^* kweb.w.dev 3 6 377 44 -99us[ +160us] +/- 21ms
赞 (0)