linux时间同步

搭建集群时,都会先设置时间同步,否则会出现多种问题。

方式一:

1.安装ntp软件

yum install -y ntp

2.更新时区

删除原有时区:sudo rm -f /etc/localtime

加载新时区:sudo ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

更新时区: ntpdate -u ntp.aliyun.com

3.设置开机自启动

systemctl start ntpd

systemctl enable ntpd

方式二:

systemctl start chronyd

systemctl enable chronyd

3台机器上分别执行这两个命令,然后在执行下方的查看命令

systemctl status chronyd.service

相关推荐
C_心欲无痕1 天前
ts - tsconfig.json配置讲解
linux·前端·ubuntu·typescript·json
冰西瓜6001 天前
国科大2025操作系统高级教程期末回忆版
linux
HIT_Weston1 天前
93、【Ubuntu】【Hugo】搭建私人博客:面包屑(一)
linux·运维·ubuntu
cuijiecheng20181 天前
Linux下Beyond Compare过期
linux·运维·服务器
喵叔哟1 天前
20.部署与运维
运维·docker·容器·.net
HIT_Weston1 天前
92、【Ubuntu】【Hugo】搭建私人博客:侧边导航栏(六)
linux·运维·ubuntu
CodeAllen嵌入式1 天前
Windows 11 本地安装 WSL 支持 Ubuntu 24.04 完整指南
linux·运维·ubuntu
期待のcode1 天前
前后端分离项目 Springboot+vue 在云服务器上的部署
服务器·vue.js·spring boot
AI 智能服务1 天前
第6课__本地工具调用(文件操作)
服务器·人工智能·windows·php
码农小韩1 天前
基于Linux的C++学习——指针
linux·开发语言·c++·学习·算法