chrony实现同步阿里云时间

2023-10-29

1. 安装chrony

yum install chrony -y
vim /etc/chrony.conf
修改chrony配置文件(替换默认的centos)
server ntp1.aliyun.com iburst
server ntp2.aliyun.com iburst
server ntp3.aliyun.com iburst
server ntp4.aliyun.com iburst

allow 192.168.0.0/16 #允许NTP客户同步ip段  NTP同步时需要配置 

2. 启动chronyd服务,并加入开机自启

[root@localhost ~]# systemctl restart chronyd
[root@localhost ~]# systemctl enable chronyd

3. 验证效果

[root@localhost ~]# timedatectl 
      Local time: Tue 2021-05-18 16:51:25 CST
  Universal time: Tue 2021-05-18 08:51:25 UTC
        RTC time: Tue 2021-05-18 08:51:25
       Time zone: Asia/Shanghai (CST, +0800)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: n/a

出现双YES就代表同步成功

配置多台可以重复配置chronyd服务也可以配置ntpdate客户端实时同步,多台情况下建议使用ntpdata客户端

4. NTP客户端同步

安装ntpdate命令
yum install ntpdate -y
同步指定NTP服务器时间
[root@es_node1 elasticsearch-7.6.2]# timedatectl 
      Local time: Tue 2021-05-18 02:23:09 CST
  Universal time: Mon 2021-05-17 18:23:09 UTC
        RTC time: Wed 2021-06-02 07:06:48
       Time zone: Asia/Shanghai (CST, +0800)
     NTP enabled: n/a
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a
[root@es_node1 elasticsearch-7.6.2]# ntpdate 192.168.24.46
 2 Jun 15:07:14 ntpdate[27888]: step time server 192.168.24.46 offset 1341819.732624 sec
[root@es_node1 elasticsearch-7.6.2]# timedatectl 
      Local time: Wed 2021-06-02 15:07:32 CST
  Universal time: Wed 2021-06-02 07:07:32 UTC
        RTC time: Wed 2021-06-02 07:07:32
       Time zone: Asia/Shanghai (CST, +0800)
     NTP enabled: n/a
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a
将NTP同步加入计划任务
*/5 * * * * /usr/sbin/ntpdate 192.168.24.46 &>/dev/null 2>&1

参考连接:https://www.cnblogs.com/linhaifeng/articles/13471989.html
本文摘选自:https://www.cnblogs.com/linhaifeng/articles/13471989.html

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

chrony实现同步阿里云时间 的相关文章

随机推荐

  • softmax分类器_Softmax 理解

    Softmax深入理解 译 AIUAI www aiuai cn Pytorch的交叉熵nn CrossEntropyLoss在训练阶段 里面是内置了softmax操作的 因此只需要喂入原始的数据结果即可 不需要在之前再添加softmax层
  • OpenWrt-SDK-编译生成ipk软件包

    版本 Barrier Breaker 类型 brcm2708 下载SDK http downloads openwrt org barrier breaker 14 07 brcm2708 generic OpenWrt SDK brcm2
  • linux部署vue项目

    命令行进入配置文件 vi usr local nginx conf nginx conf 输入i进行修改端口号和文件路径 按ESC保存后输入 wq退出 进入sbin启动nginx cd usr local nginx sbin nginx
  • FMC164-基于JESD204B的4路1Gsps AD 4路1.25Gsps DA FMC子卡

    板卡介绍 FMC164子卡集成4通道1Gsps采样率 16位AD 4通道1 25Gsps 16位DA 板载时钟芯片HMC7044 可以提供JESD204B所需要的各种时钟 具有同步 触发功能 模拟信号采用SSMC射频连接器输入和输出 板卡可
  • es 修改mappings字段结构

    es不支持直接修改mappings字段结构 可以通过 reindex 重建索引 方式修改 POST reindex source index old index dest index new index op type create Ela
  • 记录:Qt Creator 10配置安卓开发环境

    Qt Creator 现在的安卓开发环境配置相比老版本方便了不少 本文以目前在线安装版的 Qt Creator 10 0 2 Qt 5 15 Qt 6 5 为例做演示 有些文件可能会因为网络问题需要科学上网才能下载 1 下载 JDK htt
  • 【css】css动画实现的3种方式

    css实现动画主要有3种方式 transition实现过渡动画 transform转变动画 animation实现自定义动画 一 transition过渡动画 1 语法 transition property duration timing
  • UnityAPI.Transform变换(Yanlz+Unity+API+Transform+)

    UnityAPI Transform变换 版本 作者 参与者 完成日期 备注 UnityAPI Transform V01 1 0 严立钻 2018 08 21 UnityAPI Transform变换 发布说明 UnityAPI Tran
  • Linux·C++多线程基础知识

    目录 1 多线程 1 1 多进程与多线程 1 2 多线程理解 1 3 创建线程 1 4 join与detach方式 1 join举例 2 detach举例 1 5 this thread 2 mutex 2 1 lock与unlock 2
  • 【Tensorflow】tf.nn.depthwise_conv2d如何实现深度卷积?

    实验环境 tensorflow版本1 2 0 python2 7 介绍 depthwise conv2d来源于深度可分离卷积 Xception Deep Learning with Depthwise Separable Convoluti
  • C#时间字符串转换

    class Program static void Main string args DateTime datetime DateTime Now 打印当前时间 Console WriteLine 时间为 n datetime n 方法1
  • Generator 函数

    Generator 函数 基本概念 与 Iterator 接口的关系 next 方法的参数 for of 循环 Generator prototype throw Generator prototype return next throw
  • docker quick start

    文章目录 安装 验证 设置阿里云加速代理 测试 常用命令 镜像和容器存储位置 容器生命周期 Dockerfile 构建镜像 部署tomcat 基础指令 构建redis镜像 容器间Link单向通信 容器间Bridge网桥双向通信 volume
  • 【Node.js实战】一文带你开发博客项目之日志(文件读写、stream流、写日志)

    个人简介 个人主页 前端杂货铺 学习方向 主攻前端方向 也会涉及到服务端 个人状态 在校大学生一枚 已拿多个前端 offer 秋招 未来打算 为中国的工业软件事业效力n年 推荐学习 前端面试宝典 Vue2 Vue3 Vue2 Vue3项目实
  • memcache清除缓存

    打开cmd 输入 telnet localhost 11211 flush all
  • 为博客添加樱花飘落的效果

    偶然看见别人博客中樱花飘落的效果 感觉很棒 于是我也给博客加上了樱花 外链图片转存失败 源站可能有防盗链机制 建议将图片保存下来直接上传 新建 sakura js 新建一个 sakura js 文件 在里面填入下面的代码 代码来自于 折月
  • 快速排序的优化

    1 快速排序的基本思想 快速排序使用分治的思想 通过一趟排序将待排序列分割成两部分 其中一部分记录的关键字均比另一部分记录的关键字小 之后分别对这两部分记录继续进行排序 以达到整个序列有序的目的 2 快速排序的三个步骤 1 选择基准 在待排
  • 24. 在QML界面中嵌入QWidget窗口

    1 说明 目前QT官方主推的界面开发方式是采用QML进行界面设计 但在QML未流行之前 很多的项目都是采用QWidget开发的 把之前的代码全部转换为QML代码显然工作量非常大 如果能将QWidget窗口嵌入到QML界面中 那么开发效率将提
  • WTL 界面设计篇(CImageEx)

    头文件声明 CImageEx h pragma once include
  • chrony实现同步阿里云时间

    1 安装chrony yum install chrony y vim etc chrony conf 修改chrony配置文件 替换默认的centos server ntp1 aliyun com iburst server ntp2 a