kubernetes/k8s:各种错误

Q:遇到的问题及解决方案

1)dnf command not found

解决方法来源:Linux dnf 命令 command not found dnf 未找到命令 dnf 命令详解 dnf 命令未找到 dnf 命令安装 - CommandNotFound

原因:没装dnf

解决方案:

#安装 epel-release 依赖:
yum install epel-release
 
#安装 DNF 包:
yum install dnf

#查看dnf安装情况
dnf --version

如果在此过程中出现mirror问题,比如404 not found,或者try other mirrors,说明镜像源有问题,参考RHEL/RedHat:替换yum阿里源为163源 - ShineLe - 博客园解决。

2)This system is not registered with an entitlement server. You can use subscription-manager to register.

 

 

解决方案来源:This system is not registered with an entitlement server. You can use subscription-manager to regist_六位元素的博客-CSDN博客

出现于哪个环节:yum install -y yum-utils device-mapper-persistent-data lvm2

解决方案

vi /etc/yum/pluginconf.d/subscription-manager.conf,将enable=1改为enable=0

3)No such command: config-manager. Please use /usr/bin/dnf --helpIt could be a DNF plugin command, try: "dnf install 'dnf-command(config-manager)'"

 

解决方案来源:dnf缺少config-manager命令 - 程序员大本营

出现于哪个环节:dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo

 

 解决方案

sudo yum install dnf-plugins-core

4)Error: Error downloading packages:Cannot download Packages/docker-ce-cli-24.0.5-1.el7.x86_64.rpm: All mirrors were tried

解决方案来源:Linux安装docker,报错Error downloading packages: 3:docker-ce-23.0.4-1.el7.x86_64: [Errno 256]_日出时抑郁终结的博客-CSDN博客

出现于哪个环节:第2步第1)部分

dnf install docker-ce docker-ce-cli containerd.io -y

 

解决方法

修改etc/yum.repos.d/docker-ce.repo文件

[docker-ce-test]下方的enabled=0修改为1

再重新执行安装指令即可

5)(35)TCP connection reset by peer 

出现于哪个环节:第4步第1)部分

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
install minikube-linux-amd64 /usr/local/bin/minikube

原因:虚拟机无法访问这个网址(但能联网)

解决方法:

先在主机下载好,再传到虚拟机上(借助各种终端模拟器,例如XShell、tabby等)

 

6)Exiting due to DRV_AS_ROOT: The "docker" driver should not be used with root privileges.

出现于哪个环节:第4步第2)部分

minikube start --driver docker

原因:不能用root来执行docker驱动

解决方案:先切换为具体用户再执行

 

 

7)XXX is not in the sudoers file.  This incident will be reported.

解决方案来源:Linux||报错:vboxuser is not in the sudoers file. This incident will be reported._vboxuser不在sudoers文件中_Inochigohan的博客-CSDN博客

出现于哪个环节:第2步第3)部分

sudo usermod -aG docker $USER && newgrp docker

原因:vboxuser没有sudo权限,需在/etc/sudoers系统文件添加vboxuser  ALL=(ALL)  ALL语句

解决步骤:

①切换为root

su -

②编辑  /etc/sudoers

vi /etc/sudoers

③找到“root  ALL=(ALL)  ALL”一行,在下面插入“vboxuser  ALL=(ALL)  ALL”语句,保存(需要用wq!强制退出)退出

 ④查看是否修改成功

more /etc/sudoers

 ⑤返回用户,并用sudo执行

sudo usermod -aG docker $USER && newgrp docker

 

 8)Unable to load cached images

出现于哪个环节:第4步第2)部分

minikube start --driver docker

原因:部分Download需要FQ

解决方法:1)主机架个梯子,保证能ping通google.com(我用的这种方法,解决了);2)切换国内镜像源:minikube安装k8s问题:Unable to load cached images_docker_昙花逐月-华为云开发者联盟,这种方法我没有测试过,只是看到了所以贴上来

 9)

①Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

②Exiting due to DRV_DOCKER_NOT_RUNNING: Found docker, but the docker service isn't running. Try restarting the docker service.

原因:docker服务没启动,使用k8s的前提是启动docker

解决方法:

sudo systemctl restart docker

 10)minikube无法启动:“minikube service hello-minikube”无法访问问题解决 Exiting due to SVC_NOT_FOUND: Service 'test-minikube' was not found in 'defa

minikube无法启动:“minikube service hello-minikube”无法访问问题解决_minikube无法启动:“minikube service hello-minikube”无_程序员不鸣的博客-CSDN博客

均需要挂梯子,再重试

posted @   ShineLe  阅读(184)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· 百万级群聊的设计实践
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
· 永远不要相信用户的输入:从 SQL 注入攻防看输入验证的重要性
点击右上角即可分享
微信分享提示