首页 > 系统相关 >CentOS同步阿里云时钟

CentOS同步阿里云时钟

时间:2023-09-26 10:04:00浏览次数:38  
标签:25 27 CentOS chronyd chrony 阿里 master k8s 时钟

  1. 安装Chrony
[root@k8s-master opt]# yum install chrony
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.ustc.edu.cn
 * updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package chrony.x86_64 0:3.4-1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================================================================================
 Package                                    Arch                                       Version                                        Repository                                Size
=====================================================================================================================================================================================
Installing:
 chrony                                     x86_64                                     3.4-1.el7                                      base                                     251 k

Transaction Summary
=====================================================================================================================================================================================
Install  1 Package

Total download size: 251 k
Installed size: 491 k
Is this ok [y/d/N]: y
Downloading packages:
chrony-3.4-1.el7.x86_64.rpm                                                                                                                                   | 251 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : chrony-3.4-1.el7.x86_64                                                                                                                                           1/1 
  Verifying  : chrony-3.4-1.el7.x86_64                                                                                                                                           1/1 

Installed:
  chrony.x86_64 0:3.4-1.el7                                                                                                                                                          

Complete!
  1. 修改配置文件
echo "server ntp1.aliyum.com iburst" > /etc/chrony.conf
  1. Chony服务 3.1 启动服务
[root@k8s-master opt]# systemctl start chronyd

3.2 设置开机启动

[root@k8s-master opt]# systemctl enable chronyd

3.3 查看服务状态

[root@k8s-master opt]# systemctl status chronyd
● chronyd.service - NTP client/server
   Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2023-09-25 15:27:18 CST; 49s ago
     Docs: man:chronyd(8)
           man:chrony.conf(5)
 Main PID: 14965 (chronyd)
   CGroup: /system.slice/chronyd.service
           └─14965 /usr/sbin/chronyd

Sep 25 15:27:18 k8s-master systemd[1]: Starting NTP client/server...
Sep 25 15:27:18 k8s-master chronyd[14965]: chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 +DEBUG)
Sep 25 15:27:18 k8s-master systemd[1]: Started NTP client/server.
Sep 25 15:27:24 k8s-master chronyd[14965]: Selected source 193.182.111.143
Sep 25 15:27:24 k8s-master chronyd[14965]: System clock wrong by 25.432037 seconds, adjustment started
Sep 25 15:27:50 k8s-master chronyd[14965]: System clock was stepped by 25.432037 seconds
Sep 25 15:27:56 k8s-master chronyd[14965]: Selected source 202.38.64.7

3.4 立刻同步时钟

[root@k8s-master opt]# chronyc tracking
Reference ID    : CA264007 (netfee.ustc.edu.cn)
Stratum         : 3
Ref time (UTC)  : Mon Sep 25 07:27:55 2023
System time     : 0.000002488 seconds fast of NTP time
Last offset     : -0.002421353 seconds
RMS offset      : 0.002421353 seconds
Frequency       : 0.000 ppm slow
Residual freq   : +103.312 ppm
Skew            : 1000000.000 ppm
Root delay      : 0.030769050 seconds
Root dispersion : 24.330072403 seconds
Update interval : 2.6 seconds
Leap status     : Normal

标签:25,27,CentOS,chronyd,chrony,阿里,master,k8s,时钟
From: https://blog.51cto.com/u_1264026/7604678

相关文章

  • Centos yum 下载全量依赖 rpm 包及离线安装
    简介通常生产环境由于安全原因都无法访问互联网。此时就需要进行离线安装,主要有两种方式:源码编译、rpm包安装。源码编译耗费时间长且缺乏编译环境,所以一般都选择使用离线rpm包安装。操作系统Centos7.9查看依赖包可以使用“yumdeplist”命令来查找rpm包的依赖列表。例如......
  • Windows Server 2019 使用 WSL(Linux子系统(Centos非官方发行版))
    启用适用于Linux的Windows子系统必须启用“适用于Linux的Windows子系统”可选功能并重启,然后才能在Windows上运行Linux发行版。以管理员身份打开PowerShell并运行:Enable-WindowsOptionalFeature-Online-FeatureNameMicrosoft-Windows-Subsystem-Linux下......
  • CentOS7安装Docker时yum过程报错
    !!!离谱yuminstall-yyum-utils\device-mapper-persistent-data\lvm2--skip-broken报错:Loadedplugins:fastestmirrorLoadingmirrorspeedsfromcachedhostfileCouldnotretrievemirrorlisthttp://mirrorlist.centos.org/?release=......
  • 问题处理 --- 阿里云虚拟主机存在iis短文件泄露漏洞修复
    问题原因win为了兼容dos系统默认启用了长文件名称缩写为短文件名称的功能解决方法关闭设置。这里有两种解决办法:1.如果是云服务器或硬件设备fsutilbehaviorsetdisable8dot312.如果是虚拟主机修改注册列表HKLM\SYSTEM\CurrentControlSet\Control\FileSystem\NtfsDisable......
  • gps北斗授时服务器(NTP时钟服务器)技术应用方案
    gps北斗授时服务器(NTP时钟服务器)技术应用方案gps北斗授时服务器(NTP时钟服务器)技术应用方案京准电子科技官微——ahjzsz随着计算机和网络通信技术的飞速发展,火电厂热工自动化系统数字化、网络化的时代已经到来。一方面它为控制和信息系统之间的数据交换、分析和应用提供了更好的......
  • centos7升级openssh9.3p1
    centos7升级openssh9.3p1制作rpm包安装依赖包yuminstall-yrpm-buildgccgcc-c++glibcglibc-developenssl-developensslpcre-develzlibzlib-develmakewgetkrb5-develpam-devellibX11-develxmkmflibXt-develinitscriptslibXt-develimakegtk2-devellrzsz创建制......
  • centos7 安装Jira
    一、个人环境1、CentOS7安装mysql5.7:https://www.cnblogs.com/panlifeng/p/17728058.html二、安装包1、java1.8.0链接:https://pan.baidu.com/s/1-lP6hwfbASMlQt7o84sMfg提取码:i7bw2、mysql5.6链接:https://pan.baidu.com/s/150wRhoRRXcGCZLHb9k70cQ提取码:quv33、Jira7.4.1......
  • centos7安装docker教程
    (目录)前言Docker分为CE和EE两大版本。CE即社区版(免费,支持周期7个月),EE即企业版,强调安全,付费使用,支持周期24个月。DockerCE分为stabletest和nightly三个更新频道。官方网站上有各种环境下的安装指南,这里主要介绍DockerCE在CentOS上的安装。1.CentOS安装......
  • rac多路径下添加lun(centos 6)
    环境:OS:Centos6.9DB:11.2.0.4 1.虚拟机添加磁盘 2.每个登录查看磁盘情况节点1:[root@rac01bin]#lsblkNAMEMAJ:MINRMSIZEROTYPEMOUNTPOINTsr011:011024M0romsda8:0......
  • centos7中 组装软件 MaSuRCA 的安装
     001、下载最新安装包下载地址:https://github.com/alekseyzimin/masurca/releases 002、解压,进入安装目录tar-xzvfMaSuRCA-4.1.0.tar.gzcdMaSuRCA-4.1.0/ 003、安装依赖(base)[[email protected]]#yum-yinstallboostboost-develgcc-c++.x86_64gp......