Tonystark
Tonystark

Reputation: 36

Hyperledger - Docker swarm fails when deploying to multiple hosts

I am following this tutorial. I ran sudo docker swarm init --advertise-addr <myip> on 1st ubuntu machine. And then I took the manager join-token and ran it on 2nd ubuntu machine and it is able to join as manager.

But the problem starts when i run docker network create --attachable --driver overlay my-net on 1st machine, it gives me following error:

Error response from daemon: rpc error: code = Unknown desc = The swarm does not have a leader. It's possible that too few managers are online. Make sure more than half of the managers are online.

If I run the above command to create network before joining the 2nd node, the network gets created successfully and the 2nd node also gets joined to the 1st swarm node. But when I do anything on the 1st Ubuntu machine, I get the same error on it.

Both Ubuntu machines are in same network and can be pinged by each other.

Ubuntu version - 17.1 64 bit

Docker version 18.03.1-ce, build 9ee9f40

Docker-compose version 1.21.2, build a133471

Upvotes: 1

Views: 1770

Answers (2)

Lalit Rajput
Lalit Rajput

Reputation: 21

Just change the IP of your Ubuntu Machine. Machine->Settings->nNetwork->select Attached to Bridged Adapter. restart your machine.

Upvotes: 0

Gari Singh
Gari Singh

Reputation: 12053

It seems that the tutorial is off as you will only end up with two managers and that is not enough to form a quorum. You can either add an additional manager node or simply create a single manager (docker swarm init) and then join a single worker using the command that is output as part of the response to docker swarm init. You should SKIP the docker swarm join-token manager step from the tutorial.

Upvotes: 1

Related Questions