AIX中如何使用NTP协议
来源:互联网 发布:ubuntu 重置系统命令 编辑:程序博客网 时间:2024/05/21 17:33
在AIX中可以用启动xntpd守护进程的方法来实现应用环境中多台机器的系统时间的统一
xntpd 是一个关于网络时间协议的守护进程,它遵循了因特网时间服务器的通用标准。在启动 xntpd时, xntpd 会读取 /etc/ntp.conf配置文件来确定网络中系统时钟服务器,以 ntp 服务器的系统时间为标准,来调整本机的系统时间。
可以用 ntpq命令来显示 xntpd 进程的内部变量。使用 ntp时应注意,xntpd 服务器和 xntpd客户端的时钟不能相差超过1000秒(16分钟)。若有大于1000秒的偏移,在客户端启动 xntpd守护进程前,用 date 命令或 ntpdate命令调整本机的系统时间,使偏移量在1000秒之内。然后启动 xntpd.
1. 构造一个NTP环境的基本步骤(假设NTP不是运行在SP上):
1.1 设置NTP服务器 (MASTER) , 其它NTP客户服务器以此服务器的时间为准,与其进行时间同步.
1.1.1 编辑 /etc/ntp.conf文件, 内容如下:
----------------------------
#broadcastclient
server 127.127.1.0
driftfile /etc/ntp.drift
tracefile /etc/ntp.trace
----------------------------
请注意文件中的 server 127.127.1.0这一行, 此处的127.127.1.0是一个特殊的地址,表示NTP主服务器是与自身的系统时钟同步.
1.1.2 编辑好 /etc/ntp.conf后,启动xntpd守护进程
# startsrc -s xntpd
也可通过调用smitty ,使 xntpd 在以后重启服务器时能自动启动.
# smitty xntpd
-> Start Using the xntpd Subsystem
-> BOTH
1.1.3 xntpd 状态查询 ,使用 #lssrc -ls xntpd
刚启动xntpd时, sys peer为 'insane', 表明xntpd还没有完成同步, .
#lssrc -ls xntpd
Program name: --/usr/sbin/xntpd
Version: -------3
Leap indicator: 11 (Leap indicator is insane.) Sys peer: ------no peer, system is insane ...
等待 6 - 10分钟后, sys peer 就不再是 'insane'了.
#lssrc -ls xntpd
Program name: --/usr/sbin/xntpd
Version: -------3
Leap indicator: 00 (No leap second today.) Sys peer: ------127.127.1.0 ...
1.2. NTP客户端的设置
1.2.1 编辑 NTP客户端上的 /etc/ntp.conf文件,内容如下:
----------------------------
#broadcastclient
server 9.185.43.189
driftfile /etc/ntp.drift
tracefile /etc/ntp.trace
----------------------------
其中的 server 9.185.43.189表明, 此客户端与IP地址为 9.185.43.189的NTP服务器进行时间同步.
1.2.2 在NTP客户端启动xntpd守护进程
# startsrc -s xntpd
也可通过调用smitty ,使 xntpd 在以后重启服务器时能自动启动.
# smitty xntpd
1.2.3 查询xntpd的状态
当 system peer不为 'insane' 时,表明客户端已与服务器端成功地进行了同步.
# lssrc -ls xntpd
Program name: --/usr/sbin/xntpd
Version: -------3
Leap indicator: 00 (No leap second today.) Sys peer: ------9.185.43.189 ...
1.3. NTP客户端查询NTP服务器
ntp客户端使用 ntpdate命令来确认是否可用指定的 ntp 服务器进行时间同步。
命令的结果会显示客户端与服务器的时间偏移。
#ntpdate -d 9.185.43.189
参数 -d:Specifies debug mode. Determines what results thentpdate command produces without actually doing them. The results appear on the screen. This flag uses unprivileged ports.
18 Mar 10:52:54 ntpdate[23578]: step time server 9.185.43.189 offset 86323.068272 sec
若时间间隔大于1000秒,使用ntpdate 进行手工调整,如:
#date
Tue Mar 18 11:06:29 BEIST 2003
#ntpdate 9.185.43.189
19 Mar 11:06:51 ntpdate[23832]: step time server 9.185.43.189 offset 86403.402607 sec
#date
Wed Mar 19 11:06:54 BEIST 2003
完成上述操作后 ntp客户端与 ntp 服务器系统时钟完成同步,ntp客户端得到了新的系统时间。
查看同步的时间间隔(poll)
# xntpdc -c peers
remote local st poll reach delay offset disp
=======================================================================
*202.103.194.85 202.103.194.150 4 128 377 0.00081 0.000143 0.00008
=======================================================================
- AIX中如何使用NTP协议
- 在AIX中使用NTP服务
- 关于WinNT和WinCE中使用NTP协议
- NTP 协议
- NTP 协议
- NTP协议
- NTP协议
- NTP协议
- NTP协议
- NTP协议
- 使用NTP协议获取网络时间代码
- AIX中RPC使用
- AIX AIX配置时间服务器(NTP) xntpd
- 配置AIX 的NTP服务
- 如何在 CentOS 中设置 NTP 服务器
- NTP协议以及ntpclinet使用 From Evernote: NTP协议以及ntpclinet使用 NTP全称是Network Time Protocol,是用来让计算机之间实现时间同步的协议
- iOS应用中NTP的使用
- iOS应用中NTP的使用
- android seekBar ratingBar
- android ExpandableListActivity
- 2阶魔方的复原的BFS写法。。。。
- android service
- Hibernate 用@TableGenerator 生成Id
- AIX中如何使用NTP协议
- jar 包详解
- list转换为JsonArray时,使用JsonValueProcessor处理有关数据类型
- 【MySQL】使用Symbolic Links以支持数据分区存储
- 策略模式(Strategy)
- Android APK反编译查看源码及资源文件
- 简单工厂模式,工厂方法模式,抽象工厂模式
- 装饰器模式
- Tornado生产骨架——mownfish介绍