博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Linux时间同步服务
阅读量:7063 次
发布时间:2019-06-28

本文共 715 字,大约阅读时间需要 2 分钟。

1.同步网络时间到系统时间ntpdate命令

[root@localhost test1]# date

Tue Sep  6 07:12:03 CST 2016

[root@localhost test1]#  ntpdate  cn.pool.ntp.org 

 6 Sep 09:18:23 ntpdate[13047]: step time server 120.25.108.11 offset 7566.199829 sec

[root@localhost test1]# date

Tue Sep  6 09:18:25 CST 2016

 cn.pool.ntp.org  (中国国家授时中心的官方时间同步服务器IP域名)

同步网络时间到系统时间后,就可以用hwclock -w将系统时间同步到硬件时间。

2.自己搭建时间同步服务器

时间同步服务器设置:

        systemctl stop firewalld

        vim  /etc/chrony.conf

             allow 172.25.254.0/24

             local stratum 10 

        systemctl restart chrony

3.如何自动同步系统时间(同步服务器时间) 

chronyc  sources  -v查看与谁同步着。

1.确定时间源地址(同步谁的时间)

172.25.254.254

2.确定客户主机使用的时间同步服务

chronyd.service

3.在chronyd.service服务中加载时间源地址

vim /etc/chrony.conf

server172.25.254.254 iburst

#systemctl restart chronyd.service

转载地址:http://krjll.baihongyu.com/

你可能感兴趣的文章
windows 上rsync客户端使用方法
查看>>
curl 上传文件
查看>>
pcre和正则表达式的误点
查看>>
眼睛问题
查看>>
UWP项目生成安装包远程安装在树莓派上
查看>>
VUE -- ejs模板的书写
查看>>
C++ 中memset 勿要对类使用
查看>>
vue2 axios 接口函数封装
查看>>
总结: 在fc23中, 安装音频mp3 视频flv 的播放插件其实很简单, 只要一步就可以了: dnf install gstreamer1-libav...
查看>>
AI 新技术革命将如何重塑就业和全球化格局?深度解读 UN 报告(中篇)
查看>>
使用subprocess模块调用系统命令
查看>>
集成第三方接口的技巧总结
查看>>
安装CentOS 6停在selinux-policy-targeted卡住的问题解决
查看>>
Mysql初始化root密码和允许远程访问
查看>>
VMPlayer Ubuntu 16.04 Copy and Paste with Host 主机与宿机之间的复制粘贴
查看>>
Ubantu 16.04升级内核版本和还原到升级之前的内核版本的方法
查看>>
shiro 静态页面资源不显示 解决方案(转)
查看>>
js 事件详解 冒泡
查看>>
TransE论文剩余部分
查看>>
nodejs小问题拾遗
查看>>