配置SOLARIS下的NTP服务
1、查看是否安装了NTP软件包(默认是安装的),有下面两行则是已安装
# pkginfo | grep ntp
system SUNWntpr NTP, (Root)
system SUNWntpu NTP, (Usr)
2、编辑配置文件ntp.conf
#vi /etc/inet/ntp.conf
server ip_address prefer
driftfile /var/ntp/ntp.drift
3、创建drift文件
touch /var/ntp/ntp.drift
4、停止、启动NTP服务
/etc/init.d/xntpd start
/etc/init.d/xntpd stop
5、查看服务
ps -ef|grep ntp 查看进程
snoop |grep -i ntp 查看是否存在ntp包
6、查看其他服务器时间
ntpdate -q ip_address
如果没有标准时间源,可以使用下面两个
133.100.11.8
133.100.9.2
检测时间是否同步的脚本:
while true
do date;sleep 1;done;
更改时间
date 041820472005.03;date
系统时钟和NTPserver同步
ntpdate 218.25.39.44
注意主机同步的时候二者的时间不能相差太多,否则会不成功的。
For solaris client
cp /etc/inet/ntp.client /etc/inet/ntp.conf
vi /etc/inet/ntp.conf and replace
multicastclient 224.0.1.1
with
server ip-of-your-winntp-server
Then restart ntp
Solaris9
/etc/init.d/xntpd stop
/etc/init.d/xntpd start
Solaris10
scvadm disable ntp
scvadm enable ntp