简体   繁体   中英

Why I have been accessing the docker daemon on another machine and it always fails

I want to access the docker daemon on another machine,but it always fails.

Both machines are virtual machines.

systemctl status docker service

[root@localhost ~]# systemctl status docker.service
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: active (running) since Tue 2019-04-16 07:38:52 EDT; 3s ago
     Docs: https://docs.docker.com
 Main PID: 5191 (dockerd)
   Memory: 128.5M
   CGroup: /system.slice/docker.service
           └─5191 /usr/bin/dockerd -H unix://var/run/docker.sock -H tcp://0.0.0.0:2375

ps -ef | grep docker

[root@localhost ~]# ps -ef | grep docker
root       5191      1  1 07:38 ?        00:00:01 /usr/bin/dockerd -H unix://var/run/docker.sock -H tcp://0.0.0.0:2375
root       5800   5161  0 07:40 pts/0    00:00:00 grep --color=auto docker

netstat -tulp

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 localhost:smtp          0.0.0.0:*               LISTEN      4373/master         
tcp        0      0 0.0.0.0:ssh             0.0.0.0:*               LISTEN      4134/sshd           
tcp6       0      0 localhost:smtp          [::]:*                  LISTEN      4373/master         
tcp6       0      0 [::]:2375               [::]:*                  LISTEN      5191/dockerd        
tcp6       0      0 [::]:2377               [::]:*                  LISTEN      5191/dockerd        
tcp6       0      0 [::]:7946               [::]:*                  LISTEN      5191/dockerd        
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN      4134/sshd          

Result of access on another machine

[root@localhost dack]# docker -H tcp://192.168.233.150:2375 images
error during connect: Get http://192.168.233.150:2375/v1.39/images/json: dial tcp 192.168.233.150:2375: connect: no route to host
[root@localhost dack]# docker -H tcp://192.168.233.150:2375 info
error during connect: Get http://192.168.233.150:2375/v1.39/info: dial tcp 192.168.233.150:2375: connect: no route to host

如果允许2375端口从其他服务器连接,您可以检查防火墙吗?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM