[我的Linux技术支持生涯]运行ntpq -p出现“timed out, nothing received”错误
2012-01-31 09:50
495 查看
现象:在客户端和服务器端运行ntpq -p,均出现"timed out, nothing received",同时service ntpd status查看服务器和客户端的服务都是在正常运行。
排查:
1. 运行ntpq命令,进入交互模式,输入timeout 1000000,手动调整timeout时间,再输入peers查询,仍有 上述错误提示;
2. 查看了/etc/ntp.conf,没发现有可疑之处;
3. 在另外的两台机器中按照故障机器的/etc/ntp.conf配置ntp服务,运行ntpq -p能正确并很快得到信息;可见配置文件应该没错;
4. strace ntpq -p 查看输出的信息,发现:
connect(3, {sa_family=AF_INET, sin_port=htons(123), sin_addr=inet_addr("10.44.101.2")}, 16) = 0
而正常的机器中,这里的ip地址为127.0.0.1。
5. 查看/etc/hosts文件,客户端和服务器端的该文件,都没有"127.0.0.1 localhost.localdomain localhost"这行;
6. 在/etc/hosts添加了"127.0.0.1 localhost.localdomain localhost"这行后,运行ntpq -p能正常得到信息了。
结论:
/etc/hosts:
# Do not remove the following line, or various programs
# that require network functionality will fail.
某些人就喜欢改。
PS:使用strace可以省好多功夫。
排查:
1. 运行ntpq命令,进入交互模式,输入timeout 1000000,手动调整timeout时间,再输入peers查询,仍有 上述错误提示;
2. 查看了/etc/ntp.conf,没发现有可疑之处;
3. 在另外的两台机器中按照故障机器的/etc/ntp.conf配置ntp服务,运行ntpq -p能正确并很快得到信息;可见配置文件应该没错;
4. strace ntpq -p 查看输出的信息,发现:
connect(3, {sa_family=AF_INET, sin_port=htons(123), sin_addr=inet_addr("10.44.101.2")}, 16) = 0
而正常的机器中,这里的ip地址为127.0.0.1。
5. 查看/etc/hosts文件,客户端和服务器端的该文件,都没有"127.0.0.1 localhost.localdomain localhost"这行;
6. 在/etc/hosts添加了"127.0.0.1 localhost.localdomain localhost"这行后,运行ntpq -p能正常得到信息了。
结论:
/etc/hosts:
# Do not remove the following line, or various programs
# that require network functionality will fail.
某些人就喜欢改。
PS:使用strace可以省好多功夫。
相关文章推荐
- 关于 运行root.sh 时出错误Timed out waiting for the CRS stack to start.的解决
- linux 运行tar命令可能出现的错误
- 运行linux的脚本老是出现": No such file or directory"错误
- 在Linux系统里运行shutdown.sh命令关闭Tomcat时出现错误提示
- [我的Linux技术支持生涯] 无法使用xmanager登陆一台RHEL 5.6
- [我的Linux技术支持生涯] httpd服务启动成功但是客户端无法连接
- eclipse启动或者运行过程中tomcat出现内存溢出错误 java.lang.OutOfMemoryError: PermGen space
- 使用IDEA创建springboot项目时,出现错误Cannot download 'https://start.spring.io': connect timed out
- linux下当进程运行出现错误退出对错误信息分析
- tomcat 运行出现outofmemory错误
- [我的Linux技术支持生涯] 网卡无法激活问题的排查
- kdump的出现(基于嵌入式Linux的内核错误跟踪技术)
- windows系统正常运行转移到linux系统时出现错误
- 通过端口 1433 连接到主机 localhost 的 TCP/IP 连接失败。错误:“connect timed out。请验证连接属性。确保 SQL Server 的实例正在主机上运行,且在此端口
- [我的Linux技术支持生涯] 日志里每1小时报一次错"logrotate: ALERT exited abnormally with [1]"
- Linux 运行 apt-get install 就出现jdk installer 错误的解决方法
- linux上搭建eclipse CDT 运行出现 launch failed,binary not found 错误解决办法。 收藏
- 转载_kdump的出现(基于嵌入式Linux的内核错误跟踪技术)
- 修改桌面堆栈大小,解决运行大量程序时出现”Out of Memory”(内存不足)错误信息的问题
- linux中C程序运行时怪异的段错误--linux中因栈空间不足而出现的运行时段错误