spring-boot - Docker-compose 在运行数小时后崩溃
问题描述
我有一个在 ec2 实例上的 docker 容器中运行的 springBoot 应用程序。我运行了好几个月,但几天后(我只改变了应用程序中的小东西)。Docker崩溃,当我尝试重新启动时
docker-compose up -d
我收到此错误:
ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
我检查了那里的权限都很好。我不需要 sudo。
如果当然我可以再次启动 docker 服务。然后运行 docker-compose。..但几个小时后它再次发生。任何人都有任何想法或如何调试 ist。
[ec2-user@ip-xxxx-xxx6 docker]$ docker info
Containers: 2
Running: 2
Paused: 0
Stopped: 0
Images: 8
Server Version: 18.09.9-ce
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host 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: 894b81a4b802e4eb2a91d1ce216b8817763c29fb
runc version: 2b18fe1d885ee5083ef9f0838fee39b62d653e30
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 4.14.171-136.231.amzn2.x86_64
Operating System: Amazon Linux 2
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 983.4MiB
Name: ip-xxxxxxxx.eu-central-1.compute.internal
ID: BCL7:57U4:NUOW:UEW3:XQDK:TWMA:QKWL:GCMA:IFVH:JHCU:XE6S:JGZN
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
解决方案
似乎您在后台的 docker 守护程序停止工作。这可能与您的应用程序或安装有关。
对于第二个,您可以尝试设置一个新的/不同的 ec2 主机,看看它是否再次发生。
首先,我会检查您正在运行的 docker 容器,看看您需要更改主机上的一些配置以使其以稳定的方式运行。
推荐阅读
- node.js - 当我什至没有定义护照策略时,邮递员显示“未知身份验证策略\“本地\””
- java - 在 Spring Boot 应用程序中连接数据库的最简单的 Junit 测试
- c - 读取只有一个 scanf 的表
- python - 如何添加我可以在 Django 中添加带有查询集的评论表单吗?
- c# - 反向代理 - 根据请求路径选择路由
- python - 制作 tkinter .app 时的错误解决方案
- laravel - 谷歌 reCaptcha 与 Laravel
- ios - 我可以将 CoreML 和 PencilKit 等苹果库与 react-native 应用程序一起使用吗?
- hibernate - 从 sessionFactory.openSession() 休眠、监听或覆盖 opneSession
- c# - 在 Visual Studio 中添加嵌入式资源会引发错误 - 指定的参数超出范围