- Rdate解决Linux与Linux之间同步
- ntp解决Linux与linux之间,linux与windows之间,windows与windows之间同步问题,
- windows 同步
- Linux安装ntp服务
- 参考资料:
Rdate解决Linux与Linux之间同步
- 安装xinetd服务
- 修改vi /etc/xinetd.d/time-stream文件disable为no
- 同步时间-p为显示的意思,-s为修改
ntp解决Linux与linux之间,linux与windows之间,windows与windows之间同步问题,
ntp的必要条件就是联网,或者存在ntp局域网私服
windows 同步
将ntp服务器地址写入并点击立即更新,即可与服务器同步
Linux安装ntp服务
- 确认ntp已经安装
- 如果未安装则使用
- 修改配置文件/etc/ntp.conf
restrict default kod nomodify notrap nopeer noquery
修改为
restrict default kod nomodify notrap nopeer或者restrict [ip-ip] kod nomodify notrap nopeer
- 修改上层时间服务器 在/etc/ntp.conf中添加
或
- 启动NTP服务器,并设置为开机自启动
- 客户端同步
在客户端执行ntpdate
在执行此步骤时会出现错误:the NTP socket is in use, exiting 这是因为ntpd服务和ntpdate不可以在同一台机器同时执行 如果出现no server suitable for synchronization found错误,则等待几分钟就可以了。
- 配置CronTab来定时执行同步命令
示例(每天凌晨一点更新):
- 重启crond服务
参考资料:
鸟哥的私房菜 :http://linux.vbird.org/linux_server/0440ntp.php
Linux系统时间同步 : http://blog.chinaunix.net/uid-20672257-id-3013282.html
Rdate时间同步 : http://blog.csdn.net/wyzxg/article/details/5568475
Rdate时间同步 : http://blog.csdn.net/eliuyanmin/article/details/4461874
Windows和Linux做时间同步方法 : http://blog.csdn.net/ablo_zhou/article/details/5658916