linux在局域网下设置时间同步
来源:互联网 发布:纳斯达克100基金 知乎 编辑:程序博客网 时间:2024/05/20 23:36
第一步:
选择一个服务器作为时间同步服务器,如IC-1(IP:192.168.1.101)
在IC-1中,编辑文件/etc/ntp.conf
# For more information about this file, see the man pages# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).driftfile /var/lib/ntp/drift# Permit time synchronization with our time source, but do not# permit the source to query or modify the service on this system.restrict default kod nomodify notrap nopeer noqueryrestrict -6 default kod nomodify notrap nopeer noquery# Permit all access over the loopback interface. This could# be tightened as well, but to do so would effect some of# the administrative functions.restrict 127.0.0.1restrict -6 ::1# Hosts on local network are less restricted.#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap# Use public servers from the pool.ntp.org project.# Please consider joining the pool (http://www.pool.ntp.org/join.html).#server 0.rhel.pool.ntp.org iburst#server 1.rhel.pool.ntp.org iburst#server 2.rhel.pool.ntp.org iburst#server 3.rhel.pool.ntp.org iburstserver 127.127.1.0fudge 127.127.1.0 stratum 10#broadcast 192.168.1.255 autokey # broadcast server#broadcastclient # broadcast client#broadcast 224.0.1.1 autokey # multicast server#multicastclient 224.0.1.1 # multicast client#manycastserver 239.255.254.254 # manycast server#manycastclient 239.255.254.254 autokey # manycast client# Enable public key cryptography.#cryptoincludefile /etc/ntp/crypto/pw# Key file containing the keys and key identifiers used when operating# with symmetric key cryptography.keys /etc/ntp/keys# Specify the key identifiers which are trusted.#trustedkey 4 8 42# Specify the key identifier to use with the ntpdc utility.#requestkey 8# Specify the key identifier to use with the ntpq utility.#controlkey 8# Enable writing of statistics records.#statistics clockstats cryptostats loopstats peerstats
如上配置,其中
server 127.127.1.0fudge 127.127.1.0 stratum 10
是新加的配置,这是让本机的ntpd和本地硬件时间同步。
#server 0.rhel.pool.ntp.org iburst#server 1.rhel.pool.ntp.org iburst#server 2.rhel.pool.ntp.org iburst#server 3.rhel.pool.ntp.org iburst
为注释掉的配置信息。
第二步,启动服务:
/etc/init.d/ntpd start
第三步,在其他节点,开启定时任务,同步时间即可
crontab -e
01 * * * * ntpdate 192.168.1.101
阅读全文
0 0
- linux在局域网下设置时间同步
- Linux下局域网同步时间
- centos 局域网时间同步设置
- Linux实现局域网时间同步
- 关于局域网时间同步的设置方法
- Windows局域网通过NTP设置时间同步
- 局域网windows平台下时间同步
- Linux时间同步设置
- Linux时间同步设置
- Linux时间同步设置
- Linux设置时间同步
- 局域网内Linux服务器时间同步
- linux 局域网的时间同步配置
- 局域网内Linux服务器时间同步
- 局域网内Linux服务器时间同步
- Linux 局域网内服务器时间同步
- 局域网内Linux服务器时间同步
- Linux下时间同步
- [js高手之路]设计模式系列课程-发布者,订阅者重构购物车
- Tomcat Manager用户配置
- 一致性哈希和取模哈希的问题
- CURL error 60:
- 【C#】简单的消息管理机制
- linux在局域网下设置时间同步
- 简单的点击链接隐藏与显示div
- ajax 跨域访问java 带请求头
- 去掉标题栏,全屏
- Linq语法入门
- python发邮件的使用方法!
- 数据结构学习总结 —— 1.数据结构绪论
- 四平方和
- Android 自定义 HorizontalScrollView 打造再多图片(控件)也不怕 OOM 的横向滑动效果