云计算day23

如果服务器时间发生换乱,需要同步时间

date

ntpdate cn.ntp.org.cn

连接外网同步需要时间,可以同步
-bash: ntpdate: 未找到命令

root@dns named\]# yum search ntpdate 已加载插件:fastestmirror Loading mirror speeds from cached hostfile \* base: mirrors.aliyun.com \* epel: mirrors.aliyun.com \* extras: mirrors.aliyun.com \* updates: mirrors.aliyun.com ============================ N/S matched: ntpdate ============================ ntpdate.x86_64 : Utility to set the date and time via NTP 名称和简介匹配 only,使用"search all"试试。 \[root@dns named\]# yum -y install ntpdate.x86_64 服务器集群不能总是使用外网服务器同步时间,需要自己搭建ntp服务,服 务器对外同步时间,但是集群其他服务器与ntp服务器同步时间 步骤 1.准备一台ntp服务器主机 初始化过程在原有基础上关闭NetworkM manager 2.安装服务 \[root@dns named\]# yum search ntp 已加载插件:fastestmirror Loading mirror speeds from cached hostfile \* base: mirrors.aliyun.com \* epel: mirrors.aliyun.com\* extras: mirrors.aliyun.com \* updates: mirrors.aliyun.com ============================== N/S matched: ntp ============================== nagios-plugins-ntp.x86_64 : Nagios Plugin - check_ntp nagios-plugins-ntp-perl.x86_64 : Nagios Plugin - check_ntp.pl nodejs-sntp.noarch : SNTP v4 client (RFC4330) for Node.js ntp.x86_64 : The NTP daemon and utilities ntp-doc.noarch : NTP documen .... \[root@dns named\]# yum -y install ntp 已加载插件:fastestmirror Loading mirror speeds from cached hostfile... 3.配置文件 \[root@dns named\]# find / -name "ntp\*conf" /etc/ntp.conf \[root@dns named\]# vi /etc/ntp.conf 所选区域说明只允许本机联机访问时间,所以我们需要添加新的网段保存退出 4.启动服务,但是在启动服务之前,可以先保证时间准确 \[root@dns named\]# ntpdate cn.ntp.org.cn 24 Jul 00:26:11 ntpdate\[2996\]: adjust time server 203.107.6.88 offset 0.008444 sec \[root@dns named\]# date 2024年 07月 24日 星期三 00:26:14 CST \[root@dns named\]# 启动服务 \[root@dns named\]# systemctl restart ntpd \[root@dns named\]# 修改声生成错误的时间 \[root@web \~\]# date -s "2023-6-9 12:23:34" 2023年 06月 09日 星期五 12:23:34 CST \[root@web \~\]# date 2023年 06月 09日 星期五 12:23:38 CST \[root@web \~\]# \[root@web \~\]# ntpdate 192.168.71.147 24 Jul 00:34:40 ntpdate\[1920\]: step time server 192.168.71.147 offset 35467552.048297 sec \[root@web \~\]# date 2024年 07月 24日 星期三 00:34:46 CST \[root@web \~\]# 配置计划任务

相关推荐
容器魔方6 小时前
华为云亮相 KubeCon China 2025,开源生态引领 AI 时代技术跃迁
云原生·容器·云计算
努力的小郑11 小时前
《从IaaS到容器化:深度解析云计算三层架构与阿里云ECS+K8s协同实践》
阿里云·云计算
国际云,接待12 小时前
【视频直播出海】阿里云ApsaraVideo Live:从零搭建全球直播平台的“星际航行”指南!
阿里云·云计算·音视频
容器魔方1 天前
Volcano v1.12 正式发布!驱动云原生AI与批量计算向智能高效新阶段演进
云原生·容器·云计算
Johny_Zhao1 天前
CentOS Stream 8 高可用 Kuboard 部署方案
linux·网络·python·网络安全·docker·信息安全·kubernetes·云计算·shell·yum源·系统运维·kuboard
davenian1 天前
< 自用文儿 腾讯云 VPS > Ubuntu 24 系统,基本设置
云计算·腾讯云
机灵小和尚1 天前
腾讯云 Teo H5直传CDN空间
后端·云计算·php·腾讯云·html5
forrestzhaoc1 天前
跟AI聊了下GCP、AWS和CF全球故障
云计算·aws
运维小杨1 天前
linux云计算学习第八周,第九周
linux·学习·云计算
qq_390369532 天前
AWS之混合云
云计算·aws