linux ntp版本,Linux升级NTPD服务器-编译安装ntp-4.2.8p9与配置

1. 系统与软件版本

1.1 系统版本

CentOS6.5 x86_64

1.2 ntpd软件版本

ntp-4.2.8p9.tar.gz

1.3 下载地址

官方下载地址:http://support.ntp.org/bin/view/Main/SoftwareDownloads

参考文档:http://www.linuxfromscratch.org/blfs/view/svn/basicnet/ntp.html

2.安装前提

2.1 安装依赖包

[root@ntpserver ~]# yum install gcc gcc-c++ openssl-devel libstdc++* libcap*

2.2 备份旧版本的配置文件[root@ntpserver ~]# cp -ar /etc/ntp /etc/ntp.bak

[root@ntpserver ~]# cp /etc/ntp.conf /etc/ntp.conf.bak

[root@ntpserver ~]# cp /etc/init.d/ntpd /etc/init.d/ntpd.bak

[root@ntpserver ~]# cp /etc/sysconfig/ntpd /etc/sysconfig/ntpd.bak

[root@ntpserver ~]# cp /etc/sysconfig/ntpdate /etc/sysconfig/ntpdate.bak

2.3 卸载yum安装的ntpd服务[root@ntpserver ~]# yum erase ntp ntpdate

3. 编译安装ntp-4.2.8p9

3.1 创建/var/lib/ntp目录[root@ntpserver ~]# install -v -m710 -o ntp -g ntp -d /var/lib/ntp

3.2 编译安装ntpd[root@ntpserver ntp-4.2.8p9]# ./configure \

--prefix=/usr \

--bindir=/usr/sbin \

--sysconfdir=/etc \

--enable-linuxcaps \

--with-lineeditlibs=readline \

--docdir=/usr/share/doc/ntp-4.2.8p9 \

--enable-all-clocks \

--enable-parse-clocks \

--enable-clockctl

make && make install

[root@ntpserver ~]# ntp

ntpd        ntpdate     ntpdc       ntp-keygen  ntpq        ntptime     ntptrace    ntp-wait

4.创建配置文件[root@ntpserver ~]# cp /etc/init.d/ntpd.bak /etc/init.d/ntpd

[root@ntpserver ~]# cp /etc/sysconfig/ntpd.bak /etc/sysconfig/ntpd

[root@ntpserver ~]# cp /etc/sysconfig/ntpdate.bak /etc/sysconfig/ntpdate

[root@ntpserver ~]# mv /etc/ntp.bak /etc/ntp

[root@ntpserver ~]# cp /etc/ntp.conf.bak /etc/ntp.conf

5.配置ntp.conf

在/etc/ntp.conf配置文件添加以下参数

server 127.127.1.0

fudge 127.127.1.0 stratum 10

启动ntpd服务

[root@ntpserver ~]# service ntpd start

6. 客户端配置[root@localhost ~]# date

Sat Aug  8 08:08:13 CST 2015

/etc/ntp.conf添加服务端IP地址

server 10.17.83.106

[root@localhost ~]# ntpq -p

remote           refid      st t when poll reach   delay   offset  jitter

==============================================================================

10.17.83.106    10.17.82.25     12 u    3   64    1    0.628  4279381   0.001

等待几分钟,ntpd客户端自动去同步服务端的时间[root@localhost ~]# date

Sat Aug  8 08:11:10 CST 2015

[root@localhost ~]# date

Thu Dec 15 15:28:41 CST 2016

Windows客户端配置

383ad6c8dc0d8b1bea12e825bec8d27a.png

14154a79a6b03a38e066002b1d8f8ba7.png

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值