连接超时;连接CoreDNS服务器时无法访问任何服务器 [英] connection timed out; no servers could be reached when connect CoreDNS server

查看:1801
本文介绍了连接超时;连接CoreDNS服务器时无法访问任何服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用dig命令测试CoreDNS服务器时,它显示:connection timed out; no servers could be reached:

When I using dig command to test the CoreDNS server,it shows: connection timed out; no servers could be reached:

[root@ops001 ~]# /opt/k8s/bin/kubectl exec -ti soa-user-service-5c8b744d6d-7p9hr -n dabai-fat /bin/sh
/ # dig -t A kubernetes.default.svc.cluster.local. @10.254.0.2

; <<>> DiG 9.12.4-P2 <<>> -t A kubernetes.default.svc.cluster.local. @10.254.0.2
;; global options: +cmd
;; connection timed out; no servers could be reached

当我ping服务器时,它成功.

when I ping server,it success.

[root@ops001 ~]# /opt/k8s/bin/kubectl exec -ti soa-user-service-5c8b744d6d-7p9hr -n dabai-fat /bin/sh
/ # ping 10.254.0.2
PING 10.254.0.2 (10.254.0.2): 56 data bytes
64 bytes from 10.254.0.2: seq=0 ttl=64 time=0.100 ms
64 bytes from 10.254.0.2: seq=1 ttl=64 time=0.071 ms
64 bytes from 10.254.0.2: seq=2 ttl=64 time=0.094 ms
64 bytes from 10.254.0.2: seq=3 ttl=64 time=0.087 ms

为什么挖矿无法通过网络连接到DNS服务器?这是我的CoreDNS服务:

why the dig could not connect to DNS server althrough the network is ok?This is my CoreDNS service:

当asshara-k8s03与CoreDNS服务器的节点连接时:

when azshara-k8s03‘s node connection to CoreDNS server:

/ # telnet 10.254.0.2 53
Connection closed by foreign host

azshara-k8s02和asshara-k8s01与CoreDNS服务器的节点连接时:

when azshara-k8s02‘s and azshara-k8s01‘s node connection to CoreDNS server:

/ # telnet 10.254.0.2 53
telnet: can't connect to remote host (10.254.0.2): Connection refused

我只是困惑为什么端口53没有打开,当我使用相同的命令从主机扫描时,端口53是打开的:

I just confusing why port 53 is not open,when I scan from host using same command,the port 53 is open:

推荐答案

我终于发现某些服务器的kube-proxy无法启动,并且路由转发规则未刷新,使用此命令来启动kube-proxy可以解决此问题:

I finally find some server's kube-proxy not start,and the route foward rule not refresh,using this command to start kube-proxy fix this problem:

systemctl start kube-proxy

这篇关于连接超时;连接CoreDNS服务器时无法访问任何服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆