I'm trying to configure a simple docker swarm example on AWS.I have one manager and two worker nodes.
docker-machine create --driver amazonec2 --amazonec2-region eu-central-1 swarm-manager
docker-machine create --driver amazonec2 --amazonec2-region eu-central-1 docker1
docker-machine create --driver amazonec2 --amazonec2-region eu-central-1 docker2
I've set up docker1 and docker2 
set up /etc/default/docker:
DOCKER_OPTS="-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock"
rebooted docker and then:
sudo docker run -d swarm join --addr=172.31.5.27:2375 token://<token>
and checked it:
ubuntu@docker1:~$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
a4ae06e827a6        swarm               "/swarm join --addr=1"   28 minutes ago      Up 28 minutes       2375/tcp            admiring_blackwel
on the swarm machine:
sudo docker run -dP swarm manage token://
and I added my nodes:
ubuntu@swarm-manager:~$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                     NAMES
67f55fda2eba        swarm               "/swarm manage token:"   16 minutes ago      Up 16 minutes       0.0.0.0:32768->2375/tcp   trusting_dijkstra
ubuntu@swarm-manager:~$ docker -H tcp://127.0.0.1:32768 info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: swarm/1.2.5
Role: primary
Strategy: spread
Filters: health, port, containerslots, dependency, affinity, constraint
Nodes: 2
 (unknown): 172.31.11.143:2375
  └ ID:
  └ Status: Pending
  └ Containers: 0
  └ Reserved CPUs: 0 / 0
  └ Reserved Memory: 0 B / 0 B
  └ Labels:
  └ Error: Cannot connect to the Docker daemon. Is the docker daemon running on this host?
  └ UpdatedAt: 2016-10-29T16:34:28Z
  └ ServerVersion:
 (unknown): 172.31.5.27:2375
  └ ID:
  └ Status: Pending
  └ Containers: 0
  └ Reserved CPUs: 0 / 0
  └ Reserved Memory: 0 B / 0 B
  └ Labels:
  └ Error: Cannot connect to the Docker daemon. Is the docker daemon running on this host?
  └ UpdatedAt: 2016-10-29T16:34:38Z
ServerVersion:
Plugins:
 Volume:
 Network:
Swarm:
 NodeID:
 Is Manager: false
 Node Address:
Security Options:
Kernel Version: 4.2.0-18-generic
Operating System: linux
Architecture: amd64
CPUs: 0
Total Memory: 0 B
Name: 67f55fda2eba
Docker Root Dir:
Debug Mode (client): false
Debug Mode (server): false
WARNING: No kernel memory limit support
I can't undersrtand why imy nodes are still pending.