各操作系统配置NTP-创新互联

在成都网站制作、做网站、外贸营销网站建设中从网站色彩、结构布局、栏目设置、关键词群组等细微处着手,突出企业的产品/服务/品牌,帮助企业锁定精准用户,提高在线咨询和转化,使成都网站营销成为有效果、有回报的无锡营销推广。成都创新互联公司专业成都网站建设十年了,客户满意度97.8%,欢迎成都创新互联客户联系。

一、AIX服务器端

?编辑 /etc/ntp.conf文件,内容如下:

----------------------------

#broadcastclient

server 210.72.145.44 prefer

server 218.21.130.42

server 127.127.1.0

driftfile /etc/ntp.drift

tracefile /etc/ntp.trace

----------------------------

请注意文件中的 server 127.127.1.0这一行,此处的127.127.1.0是一特殊的地址,表示NTP主服务器是与自身的系统时钟同步.

?然后启动xntpd服务

#startsrc -s xntpd

0513-059 The xntpd Subsystem has been started. Subsystem PID is 7274732.

?查看xntpd状态:

#l***c -ls xntpd

Program name:   /usr/sbin/xntpd

Version:       3

Leap indicator: 11 (Leap indicator is insane.)  //初始化未完成

Sys peer:no peer, system is insane  //初始化未完成

Sys stratum: 16  //初始化未完成

Sys precision:  -17

Debug/Tracing:  DISABLED

Root distance:  0.000000

Root dispersion: 0.000000

Reference ID:no refid, system is insane  //初始化未完成

Reference time:no reftime, system is insane //初始化未完成

Broadcast delay: 0.003906 (sec)

Auth delay:     0.000122 (sec)

System flags:   bclient pll monitor filegen

System uptime:  40 (sec)

Clock stability: 0.000000 (sec)

Clock frequency: 0.000000 (sec)

Peer: 127.127.1.0

flags: (configured)(refclock)

stratum: 3, version: 3

our mode: client, his mode: server

Peer: 218.21.130.42

flags: (configured)

stratum: 16, version: 3

our mode: client, his mode: unspecified

Peer: 210.72.145.44

flags: (configured)(preferred)

stratum: 16, version: 3

our mode: client, his mode: unspecified

Subsystem        Group           PID        Status

xntpd           tcpip           7274732     active

等待 6 - 10分钟后, sys peer就不再是 'insane'了.

二、AIX客户端

?在/etc/ntp.conf中添加

server 192.168.15.92

driftfile /etc/ntp.drift

tracefile /etc/ntp.trace

?编辑好 /etc/ntp.conf后,启动xntpd守护进程

#startsrc -s xntpd

?xntpd状态查询 ,使用 #l***c -ls xntpd

刚启动xntpd时, sys peer为 'insane',表明xntpd还没有完成同步, .

#l***c -ls xntpd

Peer: 192.168.1.1

?NTP客户端查询NTP服务器 //可选

ntp客户端使用 ntpdate命令来确认是否可用指定的 ntp服务器进行时间同步。

命令的结果会显示客户端与服务器的时间偏移。

#ntpdate -d 192.168.15.92

?通过调用smitty,使 xntpd在以后重启服务器时能自动启动。

# smit xntpd

选择Start Using the xntpd Subsyste

选择BOTH方式,表示立即启动以及系统下次启动的时候将自动启动

通过如下命令可以看到,其实xntpd是tcpip服务组的一个子服务而已

#l***c -g tcpip

Subsystem Group PID Status

inetd tcpip 303118 active

snmpd tcpip 651356 active

xntpd tcpip 589898 active

……

同样,/etc/rc.tcpip可以看到如下的内容,表示该服务随TCPIP服务组一起启动

# Start up Network Time Protocol (NTP) daemon

start /usr/sbin/xntpd“$src_running”

客户端与服务器端的时间偏移量过大,因此即使启动客户端xntpd守护进程也会导致客户端无法与服务器端进行时间同步,ntp进程会自动关闭,需要先手动修改时间,再做ntp同步

以下正常输出:

各操作系统配置NTP

各操作系统配置NTP

带*号说明以该ip服务器同步

三、Linux配置ntp客户端

?配置ntp.conf

#vi /etc/ntp.conf

restrict default kod nomodify notrap nopeer noquery

restrict -6 default kod nomodify notrap nopeer noquery

restrict 127.0.0.1

restrict -6 ::1

server 127.127.1.0    # local clock

fudge  127.127.1.0 stratum 10

driftfile /var/lib/ntp/drift

keys /etc/ntp/keys

server 192.168.15.92 prefer

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


网页题目:各操作系统配置NTP-创新互联
本文地址:http://myzitong.com/article/djshdh.html