# Swarm environment remote cli

**URL:** https://forums.suse.com/t/swarm-environment-remote-cli/2896
**Category:** Rancher 1.x
**Created:** [May 24, 2016, 3:31pm UTC](https://forums.suse.com/t/swarm-environment-remote-cli/2896 "2016-05-24T15:31:54Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![ebishop](https://avatars.discourse-cdn.com/v4/letter/e/9dc877/32.png) [@ebishop](https://forums.suse.com/u/ebishop)
#### Post date: [May 24, 2016, 3:31pm UTC](https://forums.suse.com/t/swarm-environment-remote-cli/2896/1 "2016-05-24T15:31:55Z")

</div>

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

Results:  
$ docker ps  
Error response from daemon: Service Unavailable

The DOCKER\_HOST setting didn’t look correct, so I tried changing it to the :2375  
Results:  
$ 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.

Please, advise.

---

<div class="post-metadata">

### Author: ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)
#### Post date: [May 24, 2016, 4:47pm UTC](https://forums.suse.com/t/swarm-environment-remote-cli/2896/2 "2016-05-24T16:47:38Z")

</div>

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 🙂

---

<div class="post-metadata">

### Author: ![ebishop](https://avatars.discourse-cdn.com/v4/letter/e/9dc877/32.png) [@ebishop](https://forums.suse.com/u/ebishop)
#### Post date: [May 24, 2016, 5:07pm UTC](https://forums.suse.com/t/swarm-environment-remote-cli/2896/3 "2016-05-24T17:07:03Z")

</div>

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](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”

---

<div class="post-metadata">

### Author: ![denise](https://avatars.discourse-cdn.com/v4/letter/d/82dd89/32.png) [@denise](https://forums.suse.com/u/denise)
#### Post date: [May 27, 2016, 9:13pm UTC](https://forums.suse.com/t/swarm-environment-remote-cli/2896/4 "2016-05-27T21:13:16Z")

</div>

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.

[https://github.com/rancher/rancher/issues/4145](https://github.com/rancher/rancher/issues/4145)

---

<div class="post-metadata">

### Author: ![bradjones1](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/bradjones1/32/1388_2.png) [@bradjones1](https://forums.suse.com/u/bradjones1)
#### Post date: [June 3, 2016, 12:50am UTC](https://forums.suse.com/t/swarm-environment-remote-cli/2896/5 "2016-06-03T00:50:33Z")

</div>

> [@denise](#):
>
> 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!

---

<div class="post-metadata">

### Author: ![tdensmore](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/tdensmore/32/279_2.png) [@tdensmore](https://forums.suse.com/u/tdensmore)
#### Post date: [August 8, 2016, 5:57pm UTC](https://forums.suse.com/t/swarm-environment-remote-cli/2896/6 "2016-08-08T17:57:29Z")

</div>

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.
