1、各平台NTP时间同步服务设置概述Ver104各平台NTP时间同步服务设置概述文件版本V1.04编写人潘帝丞编写时间2009-4-29北京市天元网络技术股份有限公司本文档属北京市天元网络技术股份有限公司所有未经允许,不可全部或部分发表、复制或使用于任何目的。文件修改记录修改日期版本号修改内容修改人审核人批准人/日期2009-4-29V0.90建立文档潘帝丞2009-5-4V0.91增加拓扑图,按同事建议修正网络方面的一些命令等潘帝丞2009-5-5V1.00生成正式版本潘帝丞2009-5-8V1.01增加双机、主备时间源、Sol10环境的相关配置方法潘帝丞2009-5-8V1.02更改目录结构及
2、优化内容潘帝丞2009-5-8V1.03完善网络章节代码王超、姬晓东2009-6-17V1.04优化内容,增加SUSE、假设环境章节潘帝丞目 录1 编写目的 12 适用环境 13 假设环境 14 时钟服务器拓扑图 15 主机部分 15.1 SUN环境 25.1.1 服务端 45.1.2 客户端(192.168.9.114) 65.1.3 Cluster环境 95.1.4 结果测试 95.2 HP环境 95.2.1 命令法 95.2.2 SAM法 105.2.3 结果测试 115.3 AIX环境 115.3.1 服务端 115.3.2 客户端 115.3.3 结果测试 125.4 Linux环境
3、(RedHat AS4) 125.4.1 检查是否已经安装有ntp软件包 135.4.2 服务端 135.4.3 客户端 135.4.4 结果测试 145.5 Linux环境(Suse EL9) 145.6 MS Windows环境 155.6.1 Windows2000、XP 155.6.2 Windows98做时间服务器 165.6.3 结果测试 166 网络部分 166.1 HuaWei网络设备 166.1.1 客户端 166.1.2 结果测试 176.2 Cisco网络设备 186.2.1 客户端 186.2.2 结果测试 197 附件 197.1 主备源的设置 197.2 Solar
4、is 10中的设置 191 编写目的概述各个平台上NTP服务的配置方法,为各个工程实施提供关于配置NTP服务的支持。2 适用环境Solaris8、9、10(10见附件)HP-UXAIXLinux AS4WindowsCisco全系列网络设备HuaWei全系列网络设备3 假设环境NTP上级源:192.168.1.1NTP服务端:192.168.1.2(此源同步上级源)NTP客户端:192.168.1.34 时钟服务器拓扑图5 主机部分5.1 SUN环境无论服务端还是客户端都需检查/etc/rc2.d/S74xntpd文件是否存在如不存在,需手动建立并添加如下内容:#!/sbin/sh# Copy
5、right (c) 1996-1997 by Sun Microsystems, Inc.# All rights reserved.#ident (#)xntpd.sh 1.7 01/04/25 SMI ! -d /usr/sbin -o ! -d /usr/lib/inet & exit 1case $1 instart) -f /etc/inet/ntp.conf | exit 0 ARGS=/usr/bin/cat /etc/inet/ntp.conf | /usr/bin/nawk BEGIN first = 1 /#/ next /multicastclient/ if (firs
6、t) first = 0 printf(-s -w -m) if (NF = 1) printf( 224.0.1.1) else printf( %s, $2) next /server 127.127/ next /server|peer/ if (first) first = 0 printf(-s -w) printf( %s, $2) next if -n $ARGS ; then # Wait until date is close before starting xntpd (/usr/sbin/ntpdate $ARGS; sleep 2; /usr/lib/inet/xntp
7、d) & else /usr/lib/inet/xntpd & fi ;stop) /usr/bin/pkill -x -u 0 (ntpdate|xntpd) ;*) echo Usage: $0 start | stop exit 1 ;esacexit 05.1.1 服务端5.1.1.1 修改或建立文件/etc/inet/ntp.conf#vi /etc/inet/ntp.conf 加入如下内容:server 192.168.1.1 preferserver 127.127.1.0fudge 127.127.1.0 stratum 0 /设置在时间源级别 driftfile /var/n
8、tp/ntp.driftstatsdir /var/ntp/ntpstats/filegen peerstats file peerstats type day enablefilegen loopstats file loopstats type day enablefilegen clockstats file clockstats type day enable 顺序按“Esc : wq 回车”保存退出5.1.1.2 修改/etc/rc2.d/S74xntpd (“黑色”为需要添加到内容)#!/sbin/sh# Copyright (c) 1996-1997 by Sun Microsy
9、stems, Inc.# All rights reserved.#ident (#)xntpd.sh 1.7 01/04/25 SMI ! -d /usr/sbin -o ! -d /usr/lib/inet & exit 1case $1 instart) -f /etc/inet/ntp.conf | exit 0 ARGS=/usr/bin/cat /etc/inet/ntp.conf | /usr/bin/nawk BEGIN first = 1 /#/ next /multicastclient/ if (first) first = 0 printf(-s -w -m) if (
10、NF = 1) printf( 224.0.1.1) else printf( %s, $2) next /server 127.127/ next /server|peer/ if (first) first = 0 printf(-s -w) printf( %s, $2) next if -n $ARGS ; then # Wait until date is close before starting xntpd (/usr/sbin/ntpdate $ARGS; sleep 2; /usr/lib/inet/xntpd -l /var/ntp/ntp.log) 如果是Solari
11、s10的环境这里应该是:#(/usr/sbin/ntpdate $ARGS; sleep 2; svcadm enable ntp) else /usr/lib/inet/xntpd -l /var/ntp/ntp.log 如果是Solaris10的环境这里应该是:# svcadm enable ntp fi ;stop) /usr/bin/pkill -x -u 0 (ntpdate|xntpd)#如果是Solaris10的环境这里应该是:#svcadm disable ntp ;*) echo Usage: $0 start | stop exit 1 ;esacexit 05.1.2
12、 客户端(192.168.9.114)5.1.2.1 修改或建立文件/etc/inet/ntp.conf#vi /etc/inet/ntp.conf 加入如下内容:server 192.168.1.2 /键入NTP服务器的IP地址fudge 127.127.1.0 stratum 0 /设置在时间源级别driftfile /var/ntp/ntp.driftstatsdir /var/ntp/ntpstats/filegen peerstats file peerstats type day enablefilegen loopstats file loopstats type day ena
13、blefilegen clockstats file clockstats type day enable 顺序按“Esc : wq 回车”保存退出5.1.2.2 修改/etc/rc2.d/S74xntpd (“黑色”为需要添加到内容)#!/sbin/sh# Copyright (c) 1996-1997 by Sun Microsystems, Inc.# All rights reserved.#ident (#)xntpd.sh 1.7 01/04/25 SMI ! -d /usr/sbin -o ! -d /usr/lib/inet & exit 1case $1 instart) -f /etc/inet/ntp.conf | exit 0 ARGS=/usr/bin/cat /etc/inet/ntp.conf | /usr/bin/nawk BEGIN first = 1 /#/ next /multicastclient/ if
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1