Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1366588
  • 博文数量: 244
  • 博客积分: 3321
  • 博客等级: 中校
  • 技术积分: 2704
  • 用 户 组: 普通用户
  • 注册时间: 2009-04-26 08:17
个人简介

微信公众号:杰夫弹弹看

文章分类

全部博文(244)

文章存档

2018年(4)

2017年(32)

2016年(25)

2015年(28)

2014年(27)

2013年(34)

2012年(25)

2011年(30)

2010年(39)

分类: LINUX

2012-04-18 23:49:55

以Fedora为例,
1)找到对应对ntp软件包,比如我的OS是64位,那么对应的是ntp.x86_64
      yum search ntp
2) 安装ntp包
  sudo yum install ntp.x86_64

3)开始配置ntp的 server:
sudo vim /etc/ntp.conf

# 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.1
restrict -6 ::1

# Hosts on local network are less restricted.
restrict 172.16.66.0 mask 255.255.255.0 nomodify notrap

上面这行是允许相关的client机器可以来和server(本机)同步,

server 172.16.15.183 
配置局域网里用作NTP服务器的IP,其他的
server 0.fedora.pool.ntp.org iburst
server 1.fedora.pool.ntp.org iburst
server 2.fedora.pool.ntp.org iburst
server 3.fedora.pool.ntp.org iburst
根据的机器可以访问公网,可以有选择的注释掉。

4)配置ntp服务机器启动后自动运行,
为了使NTP服务可以在系统引导的时候自动启动,执行:
  chkconfig ntpd on
启动ntpd:
  service ntpd start
5)检查对应的同步信息,
 tail -f /var/log/messages

6) 配置client端,修改 /etc/ntp.conf
加上对应的server ip即可,
server 172.16.15.183 

同样对client机器执行 4)

7) 使用 ntpstat 来检查同步状态

参考:



阅读(2623) | 评论(0) | 转发(0) |
0

上一篇:sudoers 的理解

下一篇:灵山游记

给主人留下些什么吧!~~