docker - 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服务,它可以工作。但是为什么呢?这是一个错误还是什么?
解决方案
推荐阅读
- php - 函数参数中的接口对象是什么意思
- laravel - Laravel Auth 通过 id 手动登录
- python - 我可以使用 Django 中的中断模板标签吗
- javascript - 在 React 中使用变量更新状态
- javascript - jQuery 代码在内部样式表中不起作用
- dart - 相机不打开应用拍照并上传
- node.js - 如何从 Groovy readyAPI 中另一个子值偏好的括号中获取子节点值
- laravel - 尝试登录时有没有办法检查“adminPassword”?
- sql-server - SQL Server 存储过程在继续访问 db 时随机花费比正常时间更长的时间
- python - 我想重复我的代码 x 时间我该怎么办?