首页 > 其他 > 详细

ntp 服务器搭建

时间:2016-08-30 16:06:41      阅读:239      评论:0      收藏:0      [点我收藏+]

终于还是要搭建ntp服务器,我的架构是一台服务器可以上公网,其他内网服务器不能。

ntp服务器是C/S架构的时间同步服务器。

方案:

公网服务器搭建ntp服务器端

其他服务器为客户端

公网服务器:

[root@localhost ~]# yum install ntp

配置/etc/ntp.conf

[root@localhost ~]# more /etc/ntp.conf |grep  -v ^$|grep -v ^#

driftfile /var/lib/ntp/drift


restrict default ignore nomodify notrap nopeer noquery # ignore表示拒绝所有主机

restrict -6 default kod nomodify notrap nopeer noquery

restrict 127.0.0.1 

restrict -6 ::1


# 允许内网其他机器同步时间

restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap


# 中国这边最活跃的时间服务器 : http://www.pool.ntp.org/zone/cn

server 210.72.145.44 perfer   # 中国国家受时中心

server 202.112.10.36             # 1.cn.pool.ntp.org

server 59.124.196.83             # 0.asia.pool.ntp.org


# 允许上层时间服务器主动修改本机时间

restrict 210.72.145.44 nomodify notrap noquery

restrict 202.112.10.36 nomodify notrap noquery

restrict 59.124.196.83 nomodify notrap noquery


# 外部时间服务器不可用时,以本地时间作为时间服务

server  127.127.1.0     # local clock

fudge   127.127.1.0 stratum 10

includefile /etc/ntp/crypto/pw


客户机:

ntpdate -u 192.168.1.1(服务器内网地址)

计划任务:

0 13 * * * ntpdate -u 192.168.1.1




本文出自 “anigon的博客” 博客,请务必保留此出处http://381824.blog.51cto.com/371824/1844342

ntp 服务器搭建

原文:http://381824.blog.51cto.com/371824/1844342

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!