当前位置: 首页 > news >正文

CentOS 7 中时间快了 8 小时

1.查看系统时间

1.1 timeZone显示时区 

[admin@localhost ~]$ timedatectlLocal time: Mon 2024-04-15 18:09:19 PDTUniversal time: Tue 2024-04-16 01:09:19 UTCRTC time: Tue 2024-04-16 01:09:19Time zone: America/Los_Angeles (PDT, -0700)NTP enabled: yes
NTP synchronized: yesRTC in local TZ: noDST active: yesLast DST change: DST began atSun 2024-03-10 01:59:59 PSTSun 2024-03-10 03:00:00 PDTNext DST change: DST ends (the clock jumps one hour backwards) atSun 2024-11-03 01:59:59 PDTSun 2024-11-03 01:00:00 PST

1.2 修改时区为上海

sudo timedatectl set-timezone 'Asia/Shanghai'

2.使用NTP进行时间同步

2.1 安装 NTP 服务器包

yum install -y ntp

2.2 从 NTP 公共池时间服务器选择所需的物理服务器

NTP Servers in China, cn.pool.ntp.org

server 0.cn.pool.ntp.org
server 1.cn.pool.ntp.org
server 2.cn.pool.ntp.org
server 3.cn.pool.ntp.org

2.3 编辑 NTP 配置文件

vi /etc/ntp.conf#在服务器时间池加上中国的# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
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 iburstserver 0.cn.pool.ntp.org
server 1.cn.pool.ntp.org
server 2.cn.pool.ntp.org
server 3.cn.pool.ntp.org

2.4 启动NTP

$ sudo systemctl start ntpd

2.5 设置自启

$ sudo systemctl enable ntpd

http://www.lryc.cn/news/341033.html

相关文章:

  • itext7 pdf转图片
  • 搜维尔科技:Manus Xsens Metagloves新一代手指捕捉
  • Python与Redis:提升性能,确保可靠性,掌握最佳实践
  • GPT国内能用吗
  • 中科亿海微-CL1656功能验证开发板
  • 学习STM32第十五天
  • 【面试题】MySQL 事务的四大特性说一下?
  • 案例实践 | InterMat:基于长安链的材料数据发现与共享系统
  • 【数据挖掘】实验8:分类与预测建模
  • go语言并发实战——日志收集系统(三) 利用sarama包连接KafKa实现消息的生产与消费
  • Go 单元测试之Mysql数据库集成测试
  • Prometheus + Grafana 搭建监控仪表盘
  • 机器人管理系统的增删查改(Python)
  • 【.Net动态Web API】背景与实现原理
  • JS-43-Node.js02-安装Node.js和npm
  • 设计模式(分类)
  • 请陪伴Kimi和GPT成长
  • 优思学院|ISO45001职业健康安全管理体系是什么?
  • 抖去推短视频矩阵系统----源头开发
  • Golang函数重试机制实现
  • 工业电脑在ESOP工作站行业应用
  • java项目实战之图书管理系统(1)
  • 3DGS渐进式渲染 - 离线生成渲染视频
  • chromium 协议栈 cronet ios 踩坑案例
  • Java快速排序知识点(含面试大厂题和源码)
  • SpringBoot整合Swagger2
  • C++算法题 - 矩阵
  • 记录一个没测出来,有点严重的Bug
  • 科学突破可能开创6G通信新时代
  • 游戏、app抓包