docker containers不会自动与docker swarm一起启动

时间:2017-08-29 19:44:11

标签: docker virtual-machine containers docker-swarm

我的系统昨天崩溃,我无法恢复它。我没有说明这一点,所以我不知道所有细节,但请询问所需的任何细节。 过去,在任何VM重启时,系统都会自动开始工作,但在此次崩溃之后它就再也没有了:

这是我的po myView.dump()输出

docker info

我的docker节点ls输出:

Containers: 168
 Running: 0
 Paused: 0
 Stopped: 168
Images: 241
Server Version: 1.12.2
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 1228
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: overlay bridge host null
Swarm: pending
 NodeID: bg8sh8m6zm5llezlmcw00nqx6
 Is Manager: true
 ClusterID: 1wfvx3ze7tm1bb56a5zyk9xqs
 Managers: 1
 Nodes: 2
 Orchestration:
  Task History Retention Limit: 5
 Raft:
  Snapshot Interval: 10000
  Heartbeat Tick: 1
  Election Tick: 3
 Dispatcher:
  Heartbeat Period: 5 seconds
 CA Configuration:
  Expiry Duration: 3 months
 Node Address: ADDRESS //hidden for security reasons
Runtimes: runc
Default Runtime: runc
Security Options: apparmor seccomp
Kernel Version: 4.4.0-91-generic
Operating System: Ubuntu 16.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 6.804 GiB
Name: swarm-manager-1
ID: AXPO:VFSV:TDT3:6X7Y:QNAO:OZJN:U23R:V5S2:FU33:WUNI:CRPK:2E2C
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Insecure Registries:
 127.0.0.0/8

以下是docker ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS bg8sh8m6zm5llezlmcw00nqx6 * swarm-manager-1 Ready Active Leader c21j8nzzy3151vv06m54yyd1u swarm-worker-1 Unknown Active

的输出
node inspect swarm-manager-1

以下是[ { "ID": "bg8sh8m6zm5llezlmcw00nqx6", "Version": { "Index": 67823 }, "CreatedAt": "2016-10-13T23:46:00.580142516Z", "UpdatedAt": "2017-08-29T19:48:35.4197366Z", "Spec": { "Role": "manager", "Availability": "active" }, "Description": { "Hostname": "swarm-manager-1", "Platform": { "Architecture": "x86_64", "OS": "linux" }, "Resources": { "NanoCPUs": 2000000000, "MemoryBytes": 7305609216 }, "Engine": { "EngineVersion": "1.12.2", "Plugins": [ { "Type": "Network", "Name": "bridge" }, { "Type": "Network", "Name": "host" }, { "Type": "Network", "Name": "null" }, { "Type": "Network", "Name": "overlay" }, { "Type": "Volume", "Name": "local" } ] } }, "Status": { "State": "ready" }, "ManagerStatus": { "Leader": true, "Reachability": "reachable", "Addr": "ADDRESS" //hidden } } ]

的输出
docker node inspect swarm-worker-1

任何想法如何让它恢复工作?

1 个答案:

答案 0 :(得分:1)

在swarm worker上执行docker swarm leave,然后在master run docker swarm join-token worker上执行生成的令牌命令,返回worker。它应该开始工作。

崩溃可能导致了一个问题。这会破坏swarm的状态,因此你需要重新创建它