7

一次DNS域名解析问题排查记录

 2 years ago
source link: https://blogread.cn/it/article/7043?f=hot1
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
您现在的位置首页 --> 网络系统 --> 一次DNS域名解析问题排查记录

一次DNS域名解析问题排查记录

浏览:1410次  出处信息

   玩客项目中通过http的方式调用了其他引擎的数据。昨天同事反应,调用数据出现问题。出现问题时,现象如下:

[hailong.xhl@s006130 logs]$curl "http://demo.tbsite.net:2088/bin/search?append=k"
[hailong.xhl@s006130 logs]$curl: (7) couldn't connect to host

   继续跟踪,发现连接的是一个实体机ip,而非vip。

connect(3, {sa_family=AF_INET, sin_port=htons(2088), sin_addr=inet_addr("10.234.12.108")}, 16) = -1 EINPROGRESS (Operation now in progress)
poll([{fd=3, events=POLLOUT}], 1, 300000) = 1 ([{fd=3, revents=POLLERR|POLLHUP}])
getsockopt(3, SOL_SOCKET, SO_ERROR, [8589934703], [4]) = 0
close(3)

   这让我想起了之前安装的vipserver。vipserver是阿里自己开发的一个dns域名解析软件。查看了vipserver的日志,发现它的确把域名解析到了很多实体机ip上。

   为什么解析到实体机ip后就不能正常调用服务了呢?和对方pe沟通后得知,实体机监听的是2087端口,而vip监听的是2088端口。因此,在向实体机的2088端口发起连接请求时失败。

   另外还发现一个问题,就是同时安装vipserver的几台服务器,部分能正常解析到vip,部分解析到了实体机ip。开始很纳闷,后来发现是nscd搞的鬼。使用以下命令清除dns缓存后,所有的机器都解析到了实体机ip了。

sudo /usr/sbin/nscd -i hosts

   由于vipserver解析的ip有问题,暂时关闭了vipserver。待对方pe完成vipserver设置后,再启用。

建议继续学习:

QQ技术交流群:445447336,欢迎加入!
扫一扫订阅我的微信号:IT技术博客大学习

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK