服务重启后Docker节点关闭 [英] Docker Node is Down after service restart
问题描述
似乎我的服务器空间不足,并且某些部署的Docker堆栈出现了一些问题。花了我一段时间才弄清楚,但最终我做到了,并删除了几个容器和图像以释放一些空间。
我能够运行 service docker restart
并成功。但是,存在一些问题:
-
docker info
说,该群体正在等待 -
docker节点ls
显示了我唯一拥有的节点(领导者),它是可用的
,但它下来
-
journalctl -f -u docker
说`level = error msg =错误删除任务 error =不兼容的值module = node / agent / worker node.id =
运行 docker服务ls
时,所有服务都具有 0/1
个副本。
这是运行 docker node ls
状态:{
状态:关闭,
消息:处于\未知状态的节点心跳失败,
Addr:< ip and port>
},
ManagerStatus:{
Leader:true,
Reachability: reachable,
Addr:< ip and端口>
}
如何重新运行服务?
有时,当您重新启动或更新Docker版本时, tasks.db 文件会损坏。 / p>
这是一个未解决的问题(#34827 ),有人建议解决此问题的一种方法,即移动 tasks.db 文件并测试是否可以解决此问题,然后删除task.db文件。 Docker会自动为您创建一个新的文件。
您可以在/ var / lib / docker / swarm / worker /中找到 tasks.db 文件。 p>
我最近也遇到了同样的问题,这解决方法挽救了我的生活。我没有丢失任何与堆栈相关的数据
更新2020年10月19日
问题(#34827 )已关闭,但解决方案仍然相同,请删除task.db文件
It seems my server ran out of space and I was having some problems with some of the deployed docker stacks. Took me a while to figure it out, but eventually I did and removed a couple of containers and images to free some space.
I was able to run service docker restart
and it worked. However, there are some problems:
docker info
says the swarm is "Pending"docker node ls
shows the only node I have (Leader), it isavailable
but it isdown
journalctl -f -u docker
says `level=error msg="error removing task " error="incompatible value module=node/agent/worker node.id="
When running docker service ls
, all services have 0/1
replicas.
This is the status when running docker node ls
"Status": {
"State": "down",
"Message": "heartbeat failure for node in \"unknown\" state",
"Addr": "<ip and port>"
},
"ManagerStatus": {
"Leader": true,
"Reachability": "reachable",
"Addr": "<ip and port>"
}
How can I get my services running again?
Sometimes when you restart or update your docker version the tasks.db file gets corrupted.
This is an open issue (#34827), some people have suggested a workaround to this issue moving the tasks.db file and testing if this fixes the issue then delete the tasks.db file. Docker automatically will create a new one for you.
You can find the tasks.db file in /var/lib/docker/swarm/worker/
I've faced the same issue recently and this workaround saved my day. I didn't lose any data related to my Stacks
Update October/19/2020
issue (#34827) is closed but the solution still the same, remove the tasks.db file
这篇关于服务重启后Docker节点关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!