首页 | 博客群 | 公社 | 专栏 | 论坛 | 图片 | 资讯 | 注册 | 帮助 | 博客联播 | 随机访问
Local time zone must be set--see zic - -| 回首页 | 2007年索引 | - -让卡巴挂掉的代码

gentoo 安装NTPf服务

关键词gentoo    ntp                                          

1、安装软件
emerge ntp
2、修改配置文件
vi /etc/ntp.conf
restrict default ignore
#restrict default nomodify notrap noquery

restrict 0.asia.pool.ntp.org
restrict 1.asia.pool.ntp.org
restrict 2.asia.pool.ntp.org
restrict 3.asia.pool.ntp.org

restrict 127.0.0.1 mask 255.0.0.0
restrict 192.168.1.0 mask 255.255.255.0 nomodify

server 0.asia.pool.ntp.org
server 1.asia.pool.ntp.org
server 2.asia.pool.ntp.org
server 3.asia.pool.ntp.org
broadcastdelay 0.008
logfile /var/log/ntp.log

3、查看ntp有没有工作

ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
+arteq.com.tw 220.130.158.51 3 u 29 64 377 93.116 38.782 7.695
211.22.55.116 .INIT. 16 u - 64 0 0.000 0.000 0.000
*203.116.5.254 130.207.244.240 2 u 33 64 377 82.320 31.845 11.375
+q037240.ppp.asa 200.23.51.205 2 u 221 64 150 405.989 -117.80 40.170

ntptrace xxx.xxx.xxx.xxx
xxx.xxx.xxx.xxx: stratum 3, offset -0.029005, synch distance 0.365843
203.116.5.254: timed out, nothing received
***Request timed out

4、查看log文件

tail -f /var/log/ntp.log

12 Jul 15:35:35 ntpd[2089]: synchronized to 59.124.71.8, stratum 3
12 Jul 15:35:35 ntpd[2089]: kernel time sync status change 0001

5、启动服务

/etc/init.d/ntpd start|stop|restart

6、注意事项

服务启动之后,大约5分钟左右才能进行时间服务。看到日志文件出现同步信息,基本服务就好了, 如果过了很长时间没有同步信息或者不能提供时间服务,请检查配置文件。

参考文档:

http://linux.vbird.org/linux_server/0440ntp.php#server_ntp.conf

【作者: clay111】【访问统计:】【2007年07月12日 星期四 16:01】【注册】【打印

搜索

Google

Trackback

你可以使用这个链接引用该篇文章 http://publishblog.blogchina.com/blog/tb.b?diaryID=6367911

回复

验证码:   
评论内容: