linux 时间同步(阿里云ntp服务器)

news/2025/3/15 13:23:42/

 1、安装ntp服务

root@localhost ~]# yum -y install ntp
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile* base: mirrors.nju.edu.cn* centos-sclo-rh: mirrors.nju.edu.cn* centos-sclo-sclo: mirrors.huaweicloud.com* epel: mirrors.huaweicloud.com* extras: mirrors.nju.edu.cn* nux-dextop: mirror.li.nux.ro* updates: mirrors.nju.edu.cn
软件包 ntp-4.2.6p5-29.el7.centos.2.x86_64 已安装并且是最新版本

2、启动ntpd

[root@localhost elasticsearch]# systemctl start ntpd
[root@localhost elasticsearch]# systemctl enable ntpd#列显示了 NTP 服务器的 IP 地址或主机名
[root@localhost elasticsearch]# ntpq -premote           refid      st t when poll reach   delay   offset  jitter
==============================================================================119.28.206.193  .STEP.          16 u  614   64    0    0.000    0.000   0.000
+ntp.ams1.nl.lea 130.133.1.10     2 u   23   64    1  211.185   -1.552   6.721
+ntp1.flashdance 194.58.202.20    2 u   57   64    1  257.396    0.792   0.827
*electrode.felix 131.188.3.221    2 u   55   64    1  184.682    6.590   0.424

 3、修改ntp配置文件

vim /etc/ntp.conf
#同步阿里云时间
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server ntp.aliyun.com iburst#重启服务
systemctl restart ntpd

 4、203.107.6.88    就是阿里云的ntp服务器的ip地址了

[root@localhost elasticsearch]# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*203.107.6.88    100.107.25.114   2 u   20   64    1   29.587    6.472   0.839
 


http://www.ppmy.cn/news/1579319.html

相关文章

Apifox使用总结

将登录获取的token 赋值到接口中 登陆接口设置后置操作,代码如下 var data JSON.parse(responseBody) pm.environment.set(token, data.token)在需要配置登录的文件夹 选择 auth 选择 Bear Token 设置变量值 {{token}}

python编写的一个打砖块小游戏

游戏介绍 打砖块是一款经典的街机游戏,玩家控制底部的挡板,使球反弹以击碎上方的砖块。当球击中砖块时,砖块消失,球反弹;若球碰到挡板,则改变方向继续运动;若球掉出屏幕底部,玩家失…

a = b c 的含义

简单一句话: result condition && value; condition 为真取 value的值,condition为假就取condition的值,真取后假取前 // 示例 1: b 为真值 let b 1; let c 2; let a b && c; console.log(a); // 输出: 2// 示例 2: b 为…

【每日学点HarmonyOS Next知识】抽屉效果、树状组件、离屏渲染、上下文获取、Tab声明周期

1、HarmonyOS 如何实现抽屉效果的控件? 使用半模态框实现抽屉效果参考文档:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/ts-universal-attributes-sheet-transition-V5#%E7%A4%BA%E4%BE%8B // xxx.ets Entry Component struct SheetTr…

如何在电脑上使用 Jupyter Notebook 通过 SSH 远程连接树莓派Zero

有无数种方式通过SSH远程连接树莓派,但对于树莓派Zero 2W这种硬件资源有限的板子,因为内存有限Pycharm干脆不能通过SSH连接树莓派Zero 2W。VScode通过SSH连接时,也会因为资源有限时常断线。因此,我们就要用轻量级的编辑器Jupyter …

Java数组详解(一)

Java数组详解(一) 前言:一、创建数组及初始化1.数组的创建2.数组的初始化3.数组的使用(1).数组中元素的访问(2).数组的遍历 二、数组的引用类型三、数组的应用1.保存数据2.作为函数的参数2(1).参数传基本数据类型2(2).参数传数组类型(引用数据…

如果关闭 CONFIG_MODULE_SIG

要关闭 CONFIG_MODULE_SIG,你需要在内核配置中将其设置为 n 或者注释掉。以下是具体步骤: 进入内核配置菜单: 使用命令 make menuconfig 进入内核配置菜单。 找到并禁用 CONFIG_MODULE_SIG: 在菜单中,导航到 Enable l…

Markdown Poster – 免费Markdown转图片工具|优雅图文海报制作与社交媒体分享

Markdown Poster是什么 Markdown Poster 是一款高效的 Markdown 转图片工具,利用灵活编辑和实时预览功能帮助用户轻松制作优雅的图文海报。该工具内置丰富的海报模板和多种主题选项,支持导出为图片和 HTML 代码,适用于社交媒体分享、网站集成…