Start docker timeout problem "net/http: TLS handshake timeout"

Keywords: Docker yum Tomcat sudo

Preface

Ao Tao is lucky to have the chance to try to learn K8S with a group recently. Xiaocai is a novice. He only knows that the logo of K8S is like a fishing net and a compass. Docker's logo is a whale carrying a container swimming in the sea. From Logo alone, there must be a great relationship between them. So I decided to know about Docker first, and then install Docker to make trouble!
It's very simple, of course. In fact, when we do it, we find that the problems are one after another, especially in the installation process. Thanks to the help of beautiful women, beautiful women also encounter the same problems as me. So we checked the data together and solved the common problems at present. Let's talk about these two bug s.

Redirecting to start docker.service Job failed

1.bug details

Redirecting to /bin/systemctl start docker.service Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -

The meaning of the bug that Xiaocai checked on Baidu is: "The redirection docker. service job failed because the control process exited and the error code was displayed. See "system CTL status docker. service" and "journalctl-". I also checked some solutions, such as modifying docker.repo and restarting it. Later, because of modifying docker.repo, I later removed it for install. Later, we emptied docker.repo and then removed it for install.
2. Solution process
_After removing, you can no longer install it.
I also checked some solutions on Baidu, and tried some boldly, such as modifying docker.repo to restart, and later just because of modifying docker.repo, I can not remove it for install, then we empty docker.repo for install.

#Remove docker
 yum remove docker
 yum remove docker-selinux

#Edit docker.repo
 vi /etc/yum.repos.d/docker.repo

#install
 yum -y install docker
#View state
 systemctl status docker.service

install still cannot start
install succeeded and still couldn't start docker.service. Then try again. Later, the beauty test succeeded. We didn't restart daemon!

[root@localhost libcontainerd]# cd ~
[root@localhost ~]# cd /usr/lib/systemd/system
[root@localhost system]# ls
[root@localhost system]# vi docker.service
#Restart daemon
[root@localhost system]# systemctl daemon-reload
#Restart docker successfully
[root@localhost system]# systemctl restart docker
#View state
[root@localhost system]# systemctl status docker.service

_Doker. service starts here, but you think it's no longer successful here, oh no! search Tomcat has a timeout problem again, and we will continue to solve it below.


net/http: TLS handshake timeout - timeout

_The problem of timeout occurred in search Tomcat because there was no docker acceleration and no restart of daemon. Here's a snack of my operation chart. Then I will write down my operation process in the form of words. The details are as follows:

1. Modify the system configuration file

Configuration file path: / etc/sysconfig/docker


Add Mirror Warehouse in OPTIONS

#Add Mirror Warehouse--registry-mirror=http://f2d6cb40.m.daocloud.io],As follows:

OPTIONS=' --selinux-enabled  --log-driver=journald --registry-mirror=http://f2d6cb40.m.daocloud.io'  


2.docker acceleration

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://oprfsjwu.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker

3. Restart daemon

systemctl daemon-reload

4. Restart docker

service docker restart

5.pull Tomcat

docker pull tomcat


Summary

For the first time, I tried to contact docker's problems and solving process. I copied every process of operation to OneNote and wrote a blog after my own analysis. However, there are still some problems that may be explained, and they are not very professional. Welcome to make corrections for the dish!

Posted by scoppc on Tue, 08 Jan 2019 13:09:11 -0800