The number of nodes appears 0 in the swarm cluster

Hello, I created a swarm cluster as follows

On my workstation:

$docker pull swarm
$docker run --rm swarm create

On another docker hoster

docker run -d swarm join --addr=nodeIP:2375token://cluster_id_from_step_2

Back to the workstation

docker run -d -p 8333:2375 swarm manage token://cluster_id

If I listed the nodes running in this cluster by running the following command on my workstation, I see that nodeIP But if I ran the following command

sudo docker -H tcp://workstationIP:8333 info
Containers: 0
Images: 0
Role: primary
Strategy: spread
Filters: affinity, health, constraint, port, dependency
Nodes: 0
CPUs: 0
Total Memory: 0 B

Why can't I see the node IP address in nodes?

Note. This setting works on a private network in a virtualbox-based vagrant

Firewall

Vagrant.configure(2) do |config|
 config.vm.box = "phusion/ubuntu-14.04-amd64"
 config.vm.hostname = "docker-test-machine"
 config.vm.network "private_network", type: "dhcp"
 config.vm.network "forwarded_port", guest: 80, host: 80


 config.ssh.forward_agent = true

 config.vm.synced_folder "H:\\home_folder", "/home_folder"
 config.vm.provider "virtualbox" do |vb|
  vb.memory = 2048
  vb.cpus = 4
end

 config.vm.provision "shell", inline: <<-SCRIPT
    ## install docker
    if ! type docker >/dev/null; then
      echo "installing Docker"
      curl -sL https://get.docker.io/ | sh
      curl -sL https://raw.githubusercontent.com/dotcloud/docker/master/contrib/completion/bash/docker > /etc/bash_completion.d/docker
      adduser vagrant docker
    else
      echo "upgrading Docker"
      apt-get update
      apt-get -y install lxc-docker
    fi

  SCRIPT
end
+4
source share
1 answer

Thereafter:

docker run -d -p 8333:2375 swarm manage token://cluster_id

... your swarm manager is on port 8333not 2375; you will need to request a swarm manager with:

docker -H tcp://workstationIP:8333 info
0
source

All Articles