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?