The docker can not assess Swarm because of URL not found

I’m using Docker 1.8.2 and Swarm 0.5.0 to build a cluster; but it seems the docker can not access Swarm because URL mismatch.

Docker is trying to access ‘/v1.20/containers/create’, but in Swarm’s log, there is only ‘/containers/create’ endpoint.

Here is the detail information of Docker & Swarm:

root@mesosStagingController:~/swarm_mesos/swarm# /usr/local/gocode/bin/swarm -v
swarm version 0.5.0-dev (HEAD)
root@mesosStagingController:~/swarm_mesos/swarm# docker version
Client:
Version: 1.8.2
API version: 1.20
Go version: go1.4.2
Git commit: 0a8c2e3
Built: Thu Sep 10 19:19:00 UTC 2015
OS/Arch: linux/amd64

Server:
Version: 1.8.2
API version: 1.20
Go version: go1.4.2
Git commit: 0a8c2e3
Built: Thu Sep 10 19:19:00 UTC 2015
OS/Arch: linux/amd64
root@mesosStagingController:~/swarm_mesos/swarm# docker -H mesosStagingController1:4375 run hello-world
Post http://mesosStagingController1:4375/v1.20/containers/create: dial tcp: lookup mesosStagingController1: no such host.

  • Are you trying to connect to a TLS-enabled daemon without TLS?
  • Is your docker daemon up and running?

Hi,

Is the name mesosStagingController1 defined in /etc/hosts or in DNS? Looks like a name resolution issue.

Regards

It can be found in /etc/hosts; if I corrected it, it will report the following error:

root@mesosStagingController:~/swarm_mesos/swarm# docker -H tcp://mesosStagingController:4375 info
Error response from daemon: 404 page not found

Just correct the issue; it seems a configuration issue.