[我的Linux技术支持生涯]运行ntpq -p出现“timed out, nothing received”错误
来源:互联网 发布:帝国cms 调用栏目内容 编辑:程序博客网 时间:2024/06/06 14:13
现象:在客户端和服务器端运行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可以省好多功夫。
- [我的Linux技术支持生涯]运行ntpq -p出现“timed out, nothing received”错误
- [我的Linux技术支持生涯] 用户无法登陆
- 关于linux下wget出现connection timed out的原因
- Android中HTTP请求出现“Received authentication challenge is null”异常和“Read timed out”解决
- [我的Linux技术支持生涯] 网卡无法激活问题的排查
- [我的Linux技术支持生涯] 同网段的某些ip无法ping通另一ip
- [我的Linux技术支持生涯] bash配置文件在登陆时不起作用问题
- [我的Linux技术支持生涯] httpd服务启动成功但是客户端无法连接
- [我的Linux技术支持生涯] 无法使用xmanager登陆一台RHEL 5.6
- [我的Linux技术支持生涯] 日志里每1小时报一次错"logrotate: ALERT exited abnormally with [1]"
- 关于 运行root.sh 时出错误Timed out waiting for the CRS stack to start.的解决
- eclipse安装插件时出现Read timed out的解决方法
- tftp服务器出现Transfer timed out.的解决方法
- SecureCRT 连接Ubuntu 16.04出现Connection timed out 的问题
- ntpq –p命令查看连接的NTP服务器
- odac NET: Connection timed out错误的解决方法
- 【技术支持】Oracle报连接超时,TNS-12535:TNS:operation timed out。WARNING: inbound connection timed out (ORA-3136)
- 出现javax.servlet.ServletException: Receive timed out
- JDOM解析XML字符串(非XML文档)
- 对引用类型 dynamic 的理解
- java中的hasCode与equals理解(转载)
- HDFS
- Java学习——Java:对象的强、软、弱和虚引用
- [我的Linux技术支持生涯]运行ntpq -p出现“timed out, nothing received”错误
- BOINC在Windows Server 2008 R2下与AMD Catalyst存在某种程度的冲突
- 正则表达式
- QT中文支持
- 如何避免死锁
- android下载网络图片并缓存
- Cannot create a server using the selected type
- 中医教你如何保护五脏六腑
- 3 idiots的台词