k8s排错:The connection to the server *****:6443 was refused - did you specify the right host or por

今天运行查询时,发现命令没效果了,如下

# kubectl get nodes
The connection to the server 192.168.118.20:6443 was refused - did you specify the right host or port?

查看日志:

# journalctl -fu kubelet
-- Logs begin at 二 2021-08-24 16:15:04 CST. --
824 16:23:06 k8s-master systemd[1]: Unit kubelet.service entered failed state.
824 16:23:06 k8s-master systemd[1]: kubelet.service failed.
824 16:23:16 k8s-master systemd[1]: kubelet.service holdoff time over, scheduling restart.
824 16:23:16 k8s-master systemd[1]: Stopped kubelet: The Kubernetes Node Agent.
824 16:23:16 k8s-master systemd[1]: Started kubelet: The Kubernetes Node Agent.
824 16:23:16 k8s-master kubelet[3257]: Flag --network-plugin has been deprecated, will be removed along with dockershim.
824 16:23:16 k8s-master kubelet[3257]: E0824 16:23:16.643788    3257 server.go:204] **"Failed to load kubelet config file" err="failed to load Kubelet config file /var/lib/kubelet/config.yaml, error failed to decode: unexpected GroupVersion string: kube/etc/kubelet.d" path="/var/lib/kubelet/config.yaml"**
824 16:23:16 k8s-master systemd[1]: kubelet.service: main process exited, code=exited, status=1/FAILURE

显示/var/lib/kubelet/config.yaml 文件下的
GroupVersion字符串不对,引起kubelet.service无法启动,应该是昨天改动 静态Pod鼠标卡时改了东西,开了备份虚似机查看如下:
apiVersion: kubelet.config.k8s.io/v1beta1
再改回来。

重新启动kubelet.service

# systemctl status kubelet.service
● kubelet.service - kubelet: The Kubernetes Node Agent
   Loaded: loaded (/usr/lib/systemd/system/kubelet.service; enabled; vendor preset: disabled)
  Drop-In: /usr/lib/systemd/system/kubelet.service.d
           └─10-kubeadm.conf
   Active: active (running) since 二 2021-08-24 16:48:19 CST; 21s ago
     Docs: https://kubernetes.io/docs/
 Main PID: 3498 (kubelet)
    Tasks: 18
   Memory: 88.9M
   CGroup: /system.slice/kubelet.service
           ├─3498 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kuberne...
           ├─5399 /opt/cni/bin/loopback
           ├─5401 /opt/cni/bin/loopback
           └─5406 /opt/cni/bin/portmap

。。。。。。。
Hint: Some lines were ellipsized, use -l to show in full.

恢复正常了

# kubectl get nodes
NAME         STATUS   ROLES                  AGE   VERSION
k8s-master   Ready    control-plane,master   71d   v1.21.3
k8s-node1    Ready    <none>                 70d   v1.21.3
k8s-node2    Ready    <none>                 69d   v1.21.3

/var/lib/kubelet/config.yaml 留个底

# cat /var/lib/kubelet/config.yaml 
apiVersion: kubelet.config.k8s.io/v1beta1
authentication:
  anonymous:
    enabled: false
  webhook:
    cacheTTL: 0s
    enabled: true
  x509:
    clientCAFile: /etc/kubernetes/pki/ca.crt
authorization:
  mode: Webhook
  webhook:
    cacheAuthorizedTTL: 0s
    cacheUnauthorizedTTL: 0s
cgroupDriver: systemd
clusterDNS:
- 10.96.0.10
clusterDomain: cluster.local
cpuManagerReconcilePeriod: 0s
evictionPressureTransitionPeriod: 0s
fileCheckFrequency: 0s
healthzBindAddress: 127.0.0.1
healthzPort: 10248
httpCheckFrequency: 0s
imageMinimumGCAge: 0s
kind: KubeletConfiguration
logging: {}
nodeStatusReportFrequency: 0s
nodeStatusUpdateFrequency: 0s
rotateCertificates: true
runtimeRequestTimeout: 0s
shutdownGracePeriod: 0s
shutdownGracePeriodCriticalPods: 0s
staticPodPath: /etc/kubernetes/manifests
streamingConnectionIdleTimeout: 0s
syncFrequency: 0s
volumeStatsAggPeriod: 0s

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论
问题的报错信息是"Connection refused: no further information: localhost/127.0.0.1:8501"。这个错误通常表示连接被拒绝,没有进一步的信息可以提供。根据引用中的报错信息,可以看出这是一个关于Redis连接的错误。 根据引用中提到的解决方法,这个错误可能是因为本地计算机上没有安装或运行Redis服务导致的。要解决这个问题,您可以尝试安装并运行Redis服务。可以通过在网上搜索"安装Redis教程"来找到适合您的操作系统的安装指南。 另外,根据引用的转载文章,您可能还可以在该文章中找到有关解决此问题的更多详细信息和指导。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [jeecgboot报错信息 Connection refused: no further information: /127.0.0.1:6379](https://blog.csdn.net/weixin_53603040/article/details/122615385)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* *3* [Connection refused: no further information: localhost/127.0.0.1:6379的排错](https://blog.csdn.net/qq_39505065/article/details/108463732)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ives

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值