Scenario:
systemctl stop docker
swap off:
swapoff -a
swapon -a
systemctl start docker
docker-compose -f docker.yml up
appears:
ERROR: 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: 100).
As shown in the following results:
starting and stopping the service will cause a timeout and stuck situation .
The first time
systemctl stop docker is successful,
after that,
all operations, such as:
systemctl start docker
service start docker
will be stuck and do not move
;
Solution steps:
- systemctl status docker View docker status:
It's always been like this,
- According to the Internet, to start docker, you need to start monitoring first: dockerd
Then enter this command:
It’s strange that when the port is occupied, ps -ef and netstat-lnp can’t find it.
Finally, I found this big guy to the article, which teaches how to solve the problem of docker port occupation: https://blog. csdn.net/jabony/article/details/92759417
- Turn off keepalived to let the virtual IP drift to an available host
systemctl stop keepalived
- Find the corresponding container and close
netstat-lnp
kill -9 64604
- After the above operations, there are still some that cannot be found, but the container id can be found, as shown in blue in the figure: it says that the port is allocated by the container
Then, just delete all these containers,
cd /var/lib/docker/containers
rm -rf container id
again dockerd did not report an error,
Execution: systemctl status docker
status has changed, it is a bit of a change
,
The magic is that docker ps, docker logs, docker images, docker-compose up/down can all be used!
Don’t panic, we just ran dockerd, it’s not over yet, after ctrl+c:
systemctl start docker
systemctl status docker Let’s take a look again, it’s normal
- Configuration restore:
systemctl start keepalived
What a big deal!