切片 切片 切片 切片 切片 切片 切片 切片 切片 切片 切片 编组 3 切片 切片 路径 2 download 工具 配置对比 手册 切片 切片
如何在linux 上配置NTP 时间同步?
2014-07-14知识编号:116789
催更新

故障现象:


有些应用场景,对时间同步的要求严格,需要用到NTP同步,如何在linux上配置NTP时间同步?


解决方案:


在linux 上配置NTP 时间同步,具休操作步骤,整理如下:


1、安装软件包(在服务端和客户端): yum install ntp ;


2、服务器端配置 。

例如:

首先,服务端设定IP地址为:192.168.146.110

修改ntp配置文件 


vim /etc/ntp.conf 

server 0.redhat.pool.ntp.org //设定上级服务器 

restrict 192.168.146.0 mask 255.255.255.0 nomodify //设定哪些client机器可以和ntp server进行同步 


//启动NTP服务前,手动校正一次时间
ntpdate 0.redhat.pool.ntp.org
service ntpd restart
chkconfig ntpd on

//查看ntp服务状态
netstat -ln | grep 123
ntpstat

3、客户端配置:
ntpdate 192.168.146.110 //与NTP server 同步时间

或者定期同步
crontab  -e
*/5 * * * * /usr/sbin/ntpdate  -u 192.168.146.110     //每五分钟同步一次
   重启crond服务/etc/init.d/crond restart
ntpq -p //查看同步状态

0
知识有用,就点一下~
0
收藏 :
分享 :

鐢ㄦ埛鍚嶄笉姝g‘

鐧诲綍
鍏朵粬鐧诲綍鏂瑰紡

鎵撳紑鑱旀兂鏅洪€堿pp鎵爜杩涜鐧诲綍

鎵弿鎴愬姛!

璇峰嬁鍒锋柊鏈〉闈紝鎸夋墜鏈烘彁绀烘搷浣滐紒

浜岀淮鐮佸凡澶辨晥
鍒锋柊
当前网络不佳, 请刷新重试
图片加载中...