`docker-compose up` 使用 UnixHTTPConnectionPool 超时 [英] `docker-compose up` times out with UnixHTTPConnectionPool
问题描述
在我们的 Jenkins 代理中,我们运行了几个(大约 20 个)测试,其设置涉及为大量"服务/容器(大约 14 个)运行 docker-compose up
.
In our Jenkins agents we are running about several (around 20) tests whose setup involves running docker-compose up
for a "big" number of services/containers (around 14).
有时,我会收到以下错误:
From time to time, I'll get the following error:
ERROR: for testdb-data UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)
An HTTP request took too long to complete. Retry with --verbose to obtain debug information.
If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 60).
一直无法重现这一点.而且我仍在尝试弄清楚是否与我们的代理资源得到充分利用有关.
Haven't been able to reproduce this consistently. And I'm still trying to figure out whether or not there is a correlation with our agent's resources being at full use.
docker -v
是 1.10.1
而 docker-compose -v
是 1.13.1
.
关于这可能与什么有关的任何想法?
Any ideas about what this may be related to?
推荐答案
重启docker服务:
Restarting docker service:
sudo systemctl restart docker
并设置 DOCKER_CLIENT_TIMEOUT
和 COMPOSE_HTTP_TIMEOUT
环境变量:
and setting DOCKER_CLIENT_TIMEOUT
and COMPOSE_HTTP_TIMEOUT
environment variables:
export DOCKER_CLIENT_TIMEOUT=120
export COMPOSE_HTTP_TIMEOUT=120
目前有两种解决方法.但是问题仍然在 docker compose github 中打开:
are two workarounds for now. But the issues are still open in docker compose github:
https://github.com/docker/compose/issues/3927
https://github.com/docker/compose/issues/4486
https://github.com/docker/compose/issues/3834
这篇关于`docker-compose up` 使用 UnixHTTPConnectionPool 超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!