1.问题描述

跟着b站的教程部署k8s ,部署完后发现后  另外两个节点一直时notready。百度了很多方法,依然不发解决这个问题,无奈重重新安装,重新安装时仍然发现很多问题,

2. 问题原因

 vi /etc/resolv.conf 从节点没有配置nameserver 修改配置后可以安装,因为已经卸载k8s ,重新安装后正常。估计是这个原因导致的中间有的步骤没安装成功。

nameserver 8.8.8.8
nameserver 8.8.4.4
search itcast.cn

排查步骤:

执行该执行命令 只有主节点正确。两个从节点都异常
yum install -y conntrack ntpdate ntp ipvsadm ipset jq iptables curl sysstat libseccomp wget vim net-tools git

报错内容如下

jq-1.6-2.el7.x86_64.rpm        FAILED                                          
https://mirror.telkomuniversity.ac.id/epel/7/x86_64/Packages/j/jq-1.6-2.el7.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: mirror.telkomuniversity.ac.id; Unknown error"
正在尝试其它镜像。
oniguruma-6.8.2-1.el7.x86_64.r FAILED                                          
https://mirrors.bestthaihost.com/epel/7/x86_64/Packages/o/oniguruma-6.8.2-1.el7.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: mirrors.bestthaihost.com; Unknown error"
正在尝试其它镜像。


Error downloading packages:
  oniguruma-6.8.2-1.el7.x86_64: [Errno 256] No more mirrors to try.
  jq-1.6-2.el7.x86_64: [Errno 256] No more mirrors to try.

根据百度提示更新yum包,依然失败
更新yum源

yum clean all
yum makecache
yum -y update

 执行命令时报错

[root@k8snode2 ~]# yum clean all
已加载插件:fastestmirror
正在清理软件源: base docker-ce-stable epel extras kubernetes updates
Cleaning up list of fastest mirrors
[root@k8snode2 ~]# yum makecache
已加载插件:fastestmirror
Determining fastest mirrors
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误"


 One of the configured repositories failed (未知),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=<repoid> ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable <repoid>
        or
            subscription-manager repos --disable=<repoid>

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot find a valid baseurl for repo: base/7/x86_64

 

 再次百度问题 发现是resolv.conf中配置不一样

 vi /etc/resolv.conf 从节点没有配置nameserver 修改配置后可以安装,因为已经卸载k8s ,重新安装后正常。估计是这个原因导致的中间有的步骤没安装成功。

nameserver 8.8.8.8
nameserver 8.8.4.4
search itcast.cn


 

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐