当前位置: 首页 > 知识库问答 >
问题:

kubeadm初始化问题-无法执行“docker信息”

陈实
2023-03-14

我试图在RHEL 7机器上设置库伯内特斯集群。当试图初始化库伯内特斯控制平面节点时,我在运行以下kubeadm init命令时遇到问题:

[root@spsvm ~]# swapoff -a
[root@spsvm ~]# kubeadm init
[init] Using Kubernetes version: v1.15.3
[preflight] Running pre-flight checks
        [WARNING HTTPProxy]: Connection to "https://15.153.133.183" uses proxy "http://16.167.28.199:8080". If that is not intended, adjust your proxy settings
        [WARNING HTTPProxyCIDR]: connection to "10.96.0.0/12" uses proxy "http://16.167.28.199:8080". This may lead to malfunctional cluster setup. Make sure that Pod and Services IP ranges specified correctly as exceptions in proxy configuration
error execution phase preflight: [preflight] Some fatal errors occurred:
        [ERROR IsDockerSystemdCheck]: cannot execute 'docker info': exit status 125
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
[root@spsvm ~]#

尝试使用“v”开关更详细地运行上述命令

[root@spsvm downloads]# kubeadm init --v=5
I0908 06:44:50.424152  175092 initconfiguration.go:105] detected and using CRI socket: /var/run/dockershim.sock
I0908 06:44:50.424335  175092 interface.go:384] Looking for default routes with IPv4 addresses
I0908 06:44:50.424342  175092 interface.go:389] Default route transits interface "ens192"
I0908 06:44:50.424449  175092 interface.go:196] Interface ens192 is up
I0908 06:44:50.424485  175092 interface.go:244] Interface "ens192" has 2 addresses :[15.153.133.183/23 fe80::20c:29ff:fe06:bddb/64].
I0908 06:44:50.424502  175092 interface.go:211] Checking addr  15.153.133.183/23.
I0908 06:44:50.424509  175092 interface.go:218] IP found 15.153.133.183
I0908 06:44:50.424516  175092 interface.go:250] Found valid IPv4 address 15.153.133.183 for interface "ens192".
I0908 06:44:50.424521  175092 interface.go:395] Found active IP 15.153.133.183
I0908 06:44:50.424570  175092 version.go:179] fetching Kubernetes version from URL: https://dl.k8s.io/release/stable-1.txt
I0908 06:44:51.470749  175092 feature_gate.go:216] feature gates: &{map[]}
[init] Using Kubernetes version: v1.15.3
[preflight] Running pre-flight checks
I0908 06:44:51.470982  175092 checks.go:581] validating Kubernetes and kubeadm version
I0908 06:44:51.471005  175092 checks.go:172] validating if the firewall is enabled and active
I0908 06:44:51.476824  175092 checks.go:209] validating availability of port 6443
I0908 06:44:51.476941  175092 checks.go:209] validating availability of port 10251
I0908 06:44:51.476959  175092 checks.go:209] validating availability of port 10252
I0908 06:44:51.476977  175092 checks.go:292] validating the existence of file /etc/kubernetes/manifests/kube-apiserver.yaml
I0908 06:44:51.476986  175092 checks.go:292] validating the existence of file /etc/kubernetes/manifests/kube-controller-manager.yaml
I0908 06:44:51.476992  175092 checks.go:292] validating the existence of file /etc/kubernetes/manifests/kube-scheduler.yaml
I0908 06:44:51.476998  175092 checks.go:292] validating the existence of file /etc/kubernetes/manifests/etcd.yaml
I0908 06:44:51.477006  175092 checks.go:439] validating if the connectivity type is via proxy or direct
        [WARNING HTTPProxy]: Connection to "https://<HOST IP Address>" uses proxy "http://<PROXY-SERVER>:8080". If that is not intended, adjust your proxy settings
I0908 06:44:51.477058  175092 checks.go:475] validating http connectivity to first IP address in the CIDR
        [WARNING HTTPProxyCIDR]: connection to "10.96.0.0/12" uses proxy "http://<PROXY-SERVER>:8080". This may lead to malfunctional cluster setup. Make sure that Pod and Services IP ranges specified correctly as exceptions in proxy configuration
I0908 06:44:51.477087  175092 checks.go:475] validating http connectivity to first IP address in the CIDR
I0908 06:44:51.477097  175092 checks.go:105] validating the container runtime
I0908 06:44:51.504454  175092 checks.go:131] validating if the service is enabled and active
I0908 06:44:51.524856  175092 checks.go:341] validating the contents of file /proc/sys/net/bridge/bridge-nf-call-iptables
I0908 06:44:51.524893  175092 checks.go:341] validating the contents of file /proc/sys/net/ipv4/ip_forward
I0908 06:44:51.524916  175092 checks.go:653] validating whether swap is enabled or not
I0908 06:44:51.524938  175092 checks.go:382] validating the presence of executable ip
I0908 06:44:51.524955  175092 checks.go:382] validating the presence of executable iptables
I0908 06:44:51.524968  175092 checks.go:382] validating the presence of executable mount
I0908 06:44:51.524982  175092 checks.go:382] validating the presence of executable nsenter
I0908 06:44:51.524993  175092 checks.go:382] validating the presence of executable ebtables
I0908 06:44:51.525001  175092 checks.go:382] validating the presence of executable ethtool
I0908 06:44:51.525010  175092 checks.go:382] validating the presence of executable socat
I0908 06:44:51.525019  175092 checks.go:382] validating the presence of executable tc
I0908 06:44:51.525028  175092 checks.go:382] validating the presence of executable touch
I0908 06:44:51.525038  175092 checks.go:524] running all checks
I0908 06:44:51.543276  175092 checks.go:412] checking whether the given node name is reachable using net.LookupHost
I0908 06:44:51.543437  175092 checks.go:622] validating kubelet version
I0908 06:44:51.592115  175092 checks.go:131] validating if the service is enabled and active
I0908 06:44:51.597838  175092 checks.go:209] validating availability of port 10250
I0908 06:44:51.597891  175092 checks.go:209] validating availability of port 2379
I0908 06:44:51.597908  175092 checks.go:209] validating availability of port 2380
I0908 06:44:51.597928  175092 checks.go:254] validating the existence and emptiness of directory /var/lib/etcd
error execution phase preflight: [preflight] Some fatal errors occurred:
        [ERROR IsDockerSystemdCheck]: cannot execute 'docker info': exit status 125
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
[root@spsvm downloads]# 

还尝试重新启动泊坞窗守护程序。

[root@spsvm ~]# systemctl status docker.service
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/docker.service.d
           └─http-proxy.conf, https-proxy.conf
   Active: active (running) since Sun 2019-09-08 06:42:41 Asia; 2h 6min ago
     Docs: http://docs.docker.com
 Main PID: 173154 (dockerd-current)
    Tasks: 28
   CGroup: /system.slice/docker.service
           ├─173154 /usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --authori...
           └─173169 /usr/bin/docker-containerd-current -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --shim docker-containerd-shim --...

Sep 08 06:42:41 spsvm dockerd-current[173154]: time="2019-09-08T12:12:41.321838429+05:30" level=warning msg="Docker could not enable SELinux o... system"
Sep 08 06:42:41 spsvm dockerd-current[173154]: time="2019-09-08T12:12:41.336305582+05:30" level=info msg="Graph migration to content-addressab...seconds"
Sep 08 06:42:41 spsvm dockerd-current[173154]: time="2019-09-08T12:12:41.336782562+05:30" level=info msg="Loading containers: start."
Sep 08 06:42:41 spsvm dockerd-current[173154]: ........time="2019-09-08T12:12:41.343866103+05:30" level=info msg="Firewalld running: false"
Sep 08 06:42:41 spsvm dockerd-current[173154]: time="2019-09-08T12:12:41.419818528+05:30" level=info msg="Default bridge (docker0) is assigned...address"
Sep 08 06:42:41 spsvm dockerd-current[173154]: time="2019-09-08T12:12:41.446802255+05:30" level=info msg="Loading containers: done."
Sep 08 06:42:41 spsvm dockerd-current[173154]: time="2019-09-08T12:12:41.446846947+05:30" level=info msg="Daemon has completed initialization"
Sep 08 06:42:41 spsvm dockerd-current[173154]: time="2019-09-08T12:12:41.446859216+05:30" level=info msg="Docker daemon" commit="ec8512b/1.12....n=1.12.6
Sep 08 06:42:41 spsvm dockerd-current[173154]: time="2019-09-08T12:12:41.452889758+05:30" level=info msg="API listen on /var/run/docker.sock"
Sep 08 06:42:41 spsvm systemd[1]: Started Docker Application Container Engine.
Hint: Some lines were ellipsized, use -l to show in full.
[root@spsvm ~]#
[root@spsvm ~]# docker info
Containers: 8
 Running: 0
 Paused: 0
 Stopped: 8
Images: 49
Server Version: 1.12.6
Storage Driver: devicemapper
 Pool Name: docker-253:5-393385-pool
 Pool Blocksize: 65.54 kB
 Base Device Size: 10.74 GB
 Backing Filesystem: xfs
 Data file: /dev/loop1
 Metadata file: /dev/loop2
 Data Space Used: 2.788 GB
 Data Space Total: 107.4 GB
 Data Space Available: 27.15 GB
 Metadata Space Used: 3.555 MB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.144 GB
 Thin Pool Minimum Free Space: 10.74 GB
 Udev Sync Supported: true
 Deferred Removal Enabled: true
 Deferred Deletion Enabled: true
 Deferred Deleted Device Count: 0
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 WARNING: Usage of loopback devices is strongly discouraged for production use. Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.146-RHEL7 (2018-01-22)
Logging Driver: journald
Cgroup Driver: systemd
Plugins:
 Volume: local
 Network: host null bridge overlay
 Authorization: rhel-push-plugin
Swarm: inactive
Runtimes: docker-runc runc
Default Runtime: docker-runc
Security Options: seccomp
Kernel Version: 3.10.0-514.el7.x86_64
Operating System: Red Hat Enterprise Linux Server 7.5 (Maipo)
OSType: linux
Architecture: x86_64
Number of Docker Hooks: 3
CPUs: 8
Total Memory: 62.76 GiB
Name: spsvm
ID: X4AE:GQ3M:HUOW:HL2E:SI2N:OIF6:V6Y6:NITI:FD5Q:CFZ4:ZDUY:HFFV
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Http Proxy: http://<PROXY-SERVER>:8080
Https Proxy: https://<PROXY-SERVER>:8080
Registry: https://registry.access.redhat.com/v1/
Insecure Registries:
 127.0.0.0/8
Registries: registry.access.redhat.com (secure), docker.io (secure)
[root@spsvm ~]#

从上述命令的输出中,请注意:

[ERROR IsDockerSystemdCheck]: cannot execute 'docker info': exit status 125

我们已经安装了docker,docker守护进程正在运行。我还能够执行各种docker命令,包括docker信息。这是权限问题吗?不确定还有什么地方可以解决kubeadm报告的错误?

共有2个答案

桂梓
2023-03-14

你能试试吗?

kubeadm init --ignore-preflight-errors=cri

您是否多次尝试使用库比德姆初始化,如果是这样,请做库比德重置并尝试

冯浩旷
2023-03-14

您的docker安装似乎是版本1.12.6,如下所示:

Server Version: 1.12.6

您正在尝试使用版本 1.15.3 创建群集:

Using Kubernetes version: v1.15.3

在Kubernetes 1.15发行说明中,kubeadm支持的Docker最低版本被提升到< code>1.13.1:

kubeadm:将支持的最低 Docker 版本提升到 1.13.1

因此,我建议的第一件事是将Docker升级到最新且受支持的版本,即18.09

已验证的docker版本列表保持不变。

当前列表为 1.13.1、17.03、17.06、17.09、18.06、18.09。

 类似资料:
  • 我是kubernetes的新手,正在尝试配置kubernetes主节点,我已经安装了kubeadm、kubectl和kubelet,如下所示 https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/ 但是当我尝试通过键入 kubeadm 时,它会给我以下错误

  • 本文向大家介绍docker mysql启动时执行初始化sql,包括了docker mysql启动时执行初始化sql的使用技巧和注意事项,需要的朋友参考一下 1.拉取Mysql镜像 docker pull mysql:5.7 2.检查mysql镜像 3.本地创建mysql外挂的目录 4.启动mysql 5.进入容器,登录mysql,检查发现已创建库 test_database 总结 以上所述是小编给

  • 我试图在karaf 4.0.3中创建一个Kafka Producer。 我的包含, 在部署代码时,我收到以下错误, 我也在下面的链接中尝试了解决方法, 卡拉夫 - Kafka OSGI 捆绑包 - 制片人问题 但仍然得到同样的错误。

  • c++中有列表初始化的操作,类似这样: 同时vector也可以这样写: 在网上查阅资料,列表初始化(写法1)用于聚合类,聚合类不能有构造函数。 而写法2应该是调用了vector类的构造函数,那么意味着vector应改该不能使用列表初始化,这是不是矛盾了呢?

  • 我有一个使用MIP SDK的Azure函数,当调用< code>MIP时,我得到以下错误。CreateMipContext(...): 令人惊讶的是,该错误仅在 Azure 上运行时发生。在本地运行时,一切都很好。 我正在使用MIP SDK v1.8.86和.NET Core 3.1。 知道OneDS是什么或者是什么导致了错误吗?

  • 新CONF:我做了一些改变来配合你所说的。现在我删除了hibernate-cfg.xml并在spring-servlet.xml中做了所有的conf: 它可能来自我的java文件吗? 错误是: Bean 类 [org.springframework.orm.hibernate4.LocalSessionFactoryBean] 的属性 'transaction' 无效:Bean 属性 'trans