latest Rancher + latest Docker on Ubuntu 14 VM.
created a swarm environment.
Generated and downloaded the config zip, and unzipped it in ~/.docker.
Followed the instructions in the UI:
Create the .docker directory: mkdir -pv ~/.docker
Extract the ZIP file that just downloaded
Copy all the files from the extracted ZIP into the .docker directory
Run export DOCKER_HOST=tcp://rancher.xxx.com:8080 DOCKER_TLS_VERIFY=1 or add to your profile
Test with docker ps
$ docker ps
Error response from daemon: Service Unavailable
The DOCKER_HOST setting didn’t look correct, so I tried changing it to the :2375
$ docker ps
An error occurred trying to connect: Get https://:2375/v1.22/containers/json: Gateway Timeout
Also looks odd…and it’s a fail.
Did you add a host and is the swarm system stack all active? What is supposed to happen is docker connects to cattle (which is why it’s
yourhostname:8080), validates the cert you were given, and sends the request to a container in the
swarm system service. “Service Unavaialble” suggests it’s not up.
The other one is because nothing is listening on 2375, we do not support unauthenticated root access to your hosts on what is usually a public IP
There are 2 services and both report “Active”
Here are the logs from Swarm_swarm_1
5/24/2016 9:25:22 AMtime=“2016-05-24T14:25:22Z” level=info msg="Using temp file /tmp/swarm026516864"
5/24/2016 9:25:22 AMtime=“2016-05-24T14:25:22Z” level=info msg="Running swarm [manage --heartbeat 2s -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock file:///tmp/swarm026516864]“
5/24/2016 9:25:22 AMtime=“2016-05-24T14:25:22Z” level=info msg=“Watching for changes F1A009ECEC41E296BB96 http://rancher.xxx.com:8080/v1"
5/24/2016 9:25:22 AMtime=“2016-05-24T14:25:22Z” level=info msg=“Listening for HTTP” addr=”/var/run/docker.sock” proto=unix
5/24/2016 9:25:22 AMtime=“2016-05-24T14:25:22Z” level=info msg=“Listening for HTTP” addr=“0.0.0.0:2375” proto=tcp
5/24/2016 9:26:25 AMtime=“2016-05-24T14:26:25Z” level=info msg="Found host: "
5/24/2016 9:26:29 AMtime=“2016-05-24T14:26:29Z” level=info msg=“Registered Engine angus at localhost:3000”
and from : Swarm_swarm-agent_1
5/24/2016 9:26:10 AMtime=“2016-05-24T14:26:09Z” level=info msg="Listening for health checks on 0.0.0.0:10240/healthcheck"
5/24/2016 9:26:10 AMtime=“2016-05-24T14:26:10Z” level=info msg=“Initializing event router” workerCount=50
5/24/2016 9:26:10 AMtime=“2016-05-24T14:26:10Z” level=info msg=“Connection established”
Those are the services that are supposed to come up.
Currently, if you aren’t using SSL, you won’t be able to connect to swarm using the generated config.
Actually it appears even with SSL, this fails. I commented on that Github issue as well, but it seems even after you get past the incorrect/unusable
ca.pem cert, Rancher gives Unauthorized when trying to send a Docker Swarm command. Thanks for your help!
Does anyone have a fix / workaround for this? I would like to be able to use Docker commands on my Rancher swarm cluster from my laptop, but so far I cannot find any good instructions or information about how to correctly connect (or even setup the proxy). FWIW - I am behind an AWS ELB that terminates my certs.