Score:0

Docker swarm can't create overlay network

cl flag

On two machines with IP addresses 10.0.0.3 and 10.0.0.10 I was experimenting with docker swarm. First I successfully created the swarm on 10.0.0.3. Then I joined the swarm from 10.0.0.10. After that I left the swarm again at 10.0.0.10 and joined as it as a manager. Then I started getting errors. The first one was using docker node ls on the first manager (10.0.0.3):

It's possible that too few managers are online. Make sure more than 
half of the managers are online.

I've tried all kinds of things and at one point was able to do

docker swarm init --force-new-cluster --advertise-addr 10.0.0.3

I could join from 10.0.0.10 again with the new token. And to create a new network on the manager server:

docker network create -d overlay db

The response is:

Error response from daemon: This node is not a swarm manager.
Use "docker swarm init" or "docker swarm join" to connect this
node to swarm and try again.

But docker node ls says:

ID                            HOSTNAME            STATUS    AVAILABILITY   MANAGER STATUS   ENGINE VERSION
xyipo03a5mm2mwy1d1p1fmkeq *   name                Ready     Active         Leader           20.10.16

docker swarm leave:

Error response from daemon: You are attempting to leave the swarm on 
a node that is participating as a manager. Removing the last manager
erases all current state of the swarm. Use `--force` to ignore this message.

And docker info says:

Swarm: active
  NodeID: xyipo03a5mm2mwy1d1p1fmkeq
  Is Manager: true
  ClusterID: woll445lh814qrrivc68cjayo
  Managers: 1
  Nodes: 1
  Default Address Pool: 10.0.0.0/8  
  SubnetSize: 24
  Data Path Port: 4789
  Orchestration:
   Task History Retention Limit: 5
  Raft:
   Snapshot Interval: 10000
   Number of Old Snapshots to Retain: 0
   Heartbeat Tick: 1
   Election Tick: 10
  Dispatcher:
   Heartbeat Period: 5 seconds
  CA Configuration:
   Expiry Duration: 3 months
   Force Rotate: 0
  Autolock Managers: false
  Root Rotation In Progress: false
  Node Address: 10.0.0.3
  Manager Addresses:
   10.0.0.3:2377

To create a network it needs to be the manager. According to the information this host is the manager. But when I try to create a network, it says it's not the manager.

I've got docker containers running on the manager server but they are not running in the swarm.

How can I reset all this, so docker swarm works like expected?

David avatar
cn flag
What version of Ubuntu are you using?
Postie avatar
cl flag
Manager is Ubuntu 22 and worker is ubuntu 20. However I noticed Docker Engine on Ubuntu 22 is older, must have installed the wrong one. Maybe that's the cause.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.