小标
2018-11-26
来源 :
阅读 3071
评论 0
摘要:本文主要向大家介绍了Linux运维知识之Linux升级NTPD服务器-编译安装ntp-4.2.8p9与配置NTPD服务器,通过具体的内容向大家展现,希望对大家学习Linux运维知识有所帮助。
本文主要向大家介绍了Linux运维知识之Linux升级NTPD服务器-编译安装ntp-4.2.8p9与配置NTPD服务器,通过具体的内容向大家展现,希望对大家学习Linux运维知识有所帮助。
1. 系统与软件版本1.1 系统版本CentOS6.5 x86_641.2 ntpd软件版本ntp-4.2.8p9.tar.gz 1.3 下载地址官方下载地址://support.ntp.org/bin/view/Main/SoftwareDownloads参考文档://www.linuxfromscratch.org/blfs/view/svn/basicnet/ntp.html2. 安装前提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 ntpdate3. 编译安装ntp-4.2.8p93.1 创建/var/lib/ntp目录[root@ntpserver ~]# install -v -m710 -o ntp -g ntp -d /var/lib/ntp3.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-wait4. 创建配置文件[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.conf5. 配置ntp.conf在/etc/ntp.conf配置文件添加以下参数server 127.127.1.0fudge 127.127.1.0 stratum 10启动ntpd服务[root@ntpserver ~]# service ntpd start6. 客户端配置[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 2016Windows客户端配置
本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注系统运维Linux频道!
喜欢 | 0
不喜欢 | 0
您输入的评论内容中包含违禁敏感词
我知道了

请输入正确的手机号码
请输入正确的验证码
您今天的短信下发次数太多了,明天再试试吧!
我们会在第一时间安排职业规划师联系您!
您也可以联系我们的职业规划师咨询:
版权所有 职坐标-一站式AI+学习就业服务平台 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
沪公网安备 31011502005948号