Ubuntu时间同步
来源:互联网 发布:ubuntu vim 查找 编辑:程序博客网 时间:2024/04/28 01:50
根据需求,我们可能需要系统做时间同步,可以当客户端,与网络时间同步;也可以当服务端,允许其他机器请求同步。
客户端1.安装同步程序sudo apt-get install ntpdate2.执行同步命令sudo ntpdate cn.pool.ntp.org
服务端1.安装同步服务器程序sudo apt-get install ntp
测试方法:
Linux的时间分为System Clock(系统时间)和Real Time Clock (硬件时间,简称RTC)。系统时间:指当前Linux Kernel中的时间。硬件时间:主板上有电池供电的时间。时间同步之后需要不要忘记将系统时间写入硬件时间。
与网络时间同步在联网的情况下,我的电脑会自动与网络事件同步,使用了同步命令会看不出效果,所以需要手动把系统时间调成一个方便判断的时间,再进行时间同步。sudo date -s "1970-01-01 08:00:00"系统时间修改为1970年1月1日早上8点date查看当前时间;也可以看右上角的时间,不过最好把时间设置成显示秒的模式,不然可能等几秒到一分钟的时间才能看到变化sudo ntpdate cn.pool.ntp.org同步时间date查看时间,对比之前看到的时间
sudo hwclock -w写入到硬件,也可以使用sudo hwclock --systohc
成为时间同步服务器
sudo /etc/init.d/ntp start开启服务
sudo date -s "1970-01-01 08:00:00"系统时间修改为1970年1月1日早上8点
ifconfig查看本机ip
查看设备a时间date
使用其他设备a执行命令sudo ntpdate “本机ip”
查看设备a时间,确认是否同步date
Reference:
http://www.cnblogs.com/liuchangchun/p/4685032.html
http://blog.csdn.net/buster2014/article/details/45331505
阅读全文
0 0
- ubuntu的时间同步
- ubuntu 时间同步
- ubuntu的时间同步
- 同步ubuntu时间
- ubuntu同步时间
- Ubuntu 时间同步问题
- ubuntu时间同步
- Ubuntu 16 时间同步
- ubuntu ntp 时间同步
- ubuntu同步网络时间
- Ubuntu系统时间同步
- ubuntu 同步网络时间
- Ubuntu时间同步
- ubuntu服务器时间同步
- ubuntu时间修改和同步
- Ubuntu 设置与同步时间
- Ubuntu如何同步网络时间
- Ubuntu命令同步网络时间
- 1006. 单词变换
- spring boot 使用FreeMarker模板
- HashMap 1.7源码阅读
- 从零搭建基于sbt和IDEA的远程spark调试工程
- Kotlin 基本语法
- Ubuntu时间同步
- 基于shell脚本的进度条
- Html入门练习
- Hyperledger Fabric V1.0– 开发者快速入门
- UVA11235
- 精锐5重新定义加密锁
- 基本数据类型的一点思考
- Mac下显示隐藏文件
- 量化和大数据将在金融创新中崛起——高盛创新研讨会