如何解决docker ps 显示容器已启动但是 docker exec 显示它没有运行
背景信息:我的k8s集群出了点问题,而且kube-apiserver得到了etcd的healthz状态错误,所以我想知道为什么。所以我只是想执行到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服务,它可以工作。但是为什么呢?是bug还是什么?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。