首页 > 解决方案 > docker ps 显示容器已启动。但 docker exec 显示它没有运行

问题描述

背景资料:我的k8s集群出了点问题,kube-apiserver报错了etcd的healthz状态,所以想知道为什么,所以只想exec到etcd容器,终于知道磁盘空间不够了(只有1G) )。

但是为什么要docker ps显示这个容器正在运行。但是docker exec告诉我它没有运行。

# curl -k https://127.0.0.1:6443/healthz
...
[-]etcd failed: reason withheld
...
healthz check failed

在此处输入图像描述

这是码头信息秀:

# docker info
Client:
 Debug Mode: false

Server:
 Containers: 37
  Running: 25
  Paused: 0
  Stopped: 12
 Images: 13
 Server Version: 19.03.11
 Storage Driver: overlay2
  Backing Filesystem: xfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: systemd
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
 init version: fec3683
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 3.10.0-1062.12.1.el7.x86_64
 Operating System: CentOS Linux 7 (Core)
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 15.67GiB
 Name: fp-2
 ID: ZBZW:QSKA:RAO6:NDF6:6BNC:WH3S:GSHO:OT5T:XWYX:WLZF:OJQ5:YA4O
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  192.168.1.111
  192.168.1.52
  127.0.0.0/8
 Registry Mirrors:
  https://system.mirror.aliyuncs.com/
 Live Restore Enabled: true


最终的解决方案是重启docker服务,它可以工作。但是为什么呢?这是一个错误还是什么?

标签: dockerkubernetesetcd

解决方案


推荐阅读