访问服务器显示我被拒绝,连接到服务器localhost:8080被拒绝(The connection to the server localhost:8080 was refused)...

连接到服务器localhost:8080被拒绝(The connection to the server localhost:8080 was refused)

我能够在Kubernetes中聚集2个节点。 主节点似乎运行正常,但在工作节点上运行任何命令都会导致错误:“与服务器localhost:8080的连接被拒绝 - 您是否指定了正确的主机或端口?”

从master(node1),

$ kubectl get nodes

NAME STATUS AGE VERSION

node1 Ready 23h v1.7.3

node2 Ready 23h v1.7.3

从工人(节点2),

$ kubectl get nodes

The connection to the server localhost:8080 was refused - did you specify the right host or port?

$ telnet localhost 8080

Trying ::1...

telnet: connect to address ::1: Connection refused

Trying 127.0.0.1...

telnet: connect to address 127.0.0.1: Connection refused

$ ping localhost

PING localhost (127.0.0.1) 56(84) bytes of data.

64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.032 ms

我不知道如何解决这个问题。 任何帮助表示赞赏。

执行时,“journalctl -xeu kubelet”我看到:“CNI无法检索网络命名空间路径:无法找到已终止容器的网络命名空间”,但这似乎与安装pod网络有关......我无法由于上述错误。

谢谢!

I was able to cluster 2 nodes together in Kubernetes. The master node seems to be running fine but running any command on the worker node results in the error: "The connection to the server localhost:8080 was refused - did you specify the right host or port?"

From master (node1),

$ kubectl get nodes

NAME STATUS AGE VERSION

node1 Ready 23h v1.7.3

node2 Ready 23h v1.7.3

From worker (node 2),

$ kubectl get nodes

The connection to the server localhost:8080 was refused - did you specify the right host or port?

$ telnet localhost 8080

Trying ::1...

telnet: connect to address ::1: Connection refused

Trying 127.0.0.1...

telnet: connect to address 127.0.0.1: Connection refused

$ ping localhost

PING localhost (127.0.0.1) 56(84) bytes of data.

64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.032 ms

I am not sure how to fix this issue. Any help is appreciated.

On executing,"journalctl -xeu kubelet" I see: "CNI failed to retrieve network namespace path: Cannot find network namespace for the terminated container", but this seems to be related to installing a pod network ... which I am not able to because of the above error.

Thanks!

原文:https://stackoverflow.com/questions/45724889

更新时间:2020-02-05 17:02

最满意答案

kubectl与kube-apiserver kubectl接口进行集群管理。 该命令适用于主节点,因为这是运行kube-apiserver的地方。 在工作节点上,只有kubelet和kube-proxy正在运行。

事实上, kubectl应该运行在客户端(如笔记本电脑,台式机)上,而不是在kubernetes节点上运行。

kubectl interfaces with kube-apiserver for cluster management. The command works on the master node because that's where kube-apiserver runs. On the worker nodes, only kubelet and kube-proxy is running.

In fact, kubectl is supposed to be run on a client (eg. laptop, desktop) and not on the kubernetes nodes.

相关问答

这是我做的: 在standalone.xml中:

...

然后在启动服务器时,您可能会遇到类似套接字绑定失败的错误。 你只需要以root身份开始野生动物,即: sudo ./standalone.sh

Here is what I d

...

由于您尚未指定,您已从设备或模拟器连接到服务器,因此我猜您正在仿真器中使用您的应用程序。 如果您从Android模拟器引用您的系统上的本地主机,则必须使用http://10.0.2.2:8080/因为Android模拟器在虚拟机中运行,因此这里127.0.0.1或localhost将是仿真器自己的环回地址。 参考: 仿真器网络 Since you have not specified you are connected to a server from the device or emulator

...

我真的不知道kubectl太多了......但是,我知道你拒绝localhost的连接的各种原因如下 1)确保您可以使用IP(127.XX.XX.XX)解析和ping您的本地主机,如果使用DNS或主机文件,也可以使用“localhost”。 2)确保尝试访问本地主机的服务具有足够的权限以root身份运行,如果尝试使用本地主机。 3)使用netstat检查端口,并在“Plantu”标志中检查所需的标志,查找每个标志的含义,因为它适用于您的情况。 如果您尝试在本地主机上访问的服务正在侦听该端口,则ne

...

“连接到http:// localhost:10080拒绝”。 这似乎表明有一些防火墙或防病毒阻止您的本地连接。 验证是否存在任何此类限制,并在需要时将其删除。 "Connection to http://localhost:10080 refused" . This seems to suggest there is some firewall or antivirus blocking your local connections. Verify if there are any such r

...

我有同样的。 按照此处的建议运行以下命令解决了我的问题。 sudo cp /etc/kubernetes/admin.conf $HOME/

sudo chown $(id -u):$(id -g) $HOME/admin.conf

export KUBECONFIG=$HOME/admin.conf

I had the same. Running the following command as suggested here solved my problem. sudo cp /etc/ku

...

如果您将pg_hba.conf文件更改为接受连接(例如:“host all all 127.0.0.1 255.255.255.0 trust”),它应该可以工作 If you change the pg_hba.conf file to accept connections (for example: "host all all 127.0.0.1 255.255.255.0 trust") it should work

kubectl与kube-apiserver kubectl接口进行集群管理。 该命令适用于主节点,因为这是运行kube-apiserver的地方。 在工作节点上,只有kubelet和kube-proxy正在运行。 事实上, kubectl应该运行在客户端(如笔记本电脑,台式机)上,而不是在kubernetes节点上运行。 kubectl interfaces with kube-apiserver for cluster management. The command works on the

...

您获得的错误似乎来自Postgres当前未运行,而不是您假定的身份验证错误。 PSQL客户端或您正在使用的任何PG客户端都试图在默认端口上建立连接,但没有任何东西存在。 如果Postgres当前没有运行,请尝试查找它(通过CTRL-Alt-Delete)。 如果它正在运行,请尝试终止并再次启动它。 希望能解决问题...否则您的端口5432可能会因某些原因被阻止。 如果全部失败,我仍然怀疑括号可能导致此错误,因为它不是身份验证错误。 尝试使用全新安装重新安装Postgres。 The error y

...

当我使用localhost以外的主机名时,我遇到了这个问题。 我发现网络服务器的默认设置只允许“localhost”地址上的连接。 要更改此设置,请在derby.properties中设置此属性 derby.drda.host = 0.0.0.0 应允许来自任何主机的连接。 我现在可以使用机器的主机名连接,即使我在同一台机器上。 如果这不是您的问题,您是否确保配置了防火墙规则? I had this problem when I was using a hostname other than lo

...

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值