Docker Swarm 无法创建覆盖网络

Docker Swarm 无法创建覆盖网络

我在两台具有 IP 地址的机器上试验了 docker swarm。首先,我在 上成功创建了 swarm 10.0.0.3。然后我从 加入了 swarm 。之后,我再次在 离开 swarm,并以管理员身份加入。然后我开始收到错误。第一个是在第一个管理器 ( ) 上使用的:10.0.0.1010.0.0.310.0.0.1010.0.0.10docker node ls10.0.0.3

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

我尝试过各种各样的事情,有一次我做到了

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

我可以10.0.0.10使用新令牌再次加入。并在管理服务器上创建一个新网络:

docker network create -d overlay db

响应是:

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.

docker node ls说:

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.

docker info说:

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

要创建网络,它必须是管理员。根据信息,此主机是管理员。但是当我尝试创建网络时,它说它不是管理员。

我在管理器服务器上运行了 Docker 容器,但它们没有在 Swarm 中运行。

我怎样才能重置这一切,以便 docker swarm 能够像预期的那样工作?

相关内容