2017-07-27 53 views
2

我已经使用docker-machine创建了3个节点swarm群Virtualbox。三个都在运行,我可以使用'docker-machine ssh'来连接每一个。有一个问题,我重新启动物理机器并且集群似乎无法工作,为什么?以下是详细信息。感谢您的指导和建议。来自守护进程的错误响应:rpc错误:code = 2 desc =群中没有领导者

[email protected]:~$ docker-machine ls

NAME  ACTIVE DRIVER  STATE  URL       
SWARM DOCKER  ERRORS 
first -  virtualbox Running tcp://192.168.99.100:2376   
v17.06.0-ce 
second -  virtualbox Running tcp://192.168.99.101:2376   
v17.06.0-ce 
third -  virtualbox Running tcp://192.168.99.102:2376   
v17.06.0-ce 

The first is a leader and the second is a manager while the third is a worker.I tried to use 'docker-machine ssh first docker node ls'.

Error response from daemon: 

`rpc error: code = 2 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. 
exit status 1 

ん@ SAN的系统 - 产品名称:〜$搬运工机器的ssh第一泊坞窗信息

Containers: 2 
Running: 0 Paused: 0 Stopped: 2 
Images: 3 
Server Version: 17.06.0-ce 
Storage Driver: aufs 
    Root Dir: /mnt/sda1/var/lib/docker/aufs 
    Backing Filesystem: extfs 
    Dirs: 17 
    Dirperm1 Supported: true 
Logging Driver: json-file 
Cgroup Driver: cgroupfs 
Plugins: 
    Volume: local 
    Network: bridge host macvlan null overlay 
    Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog 
Swarm: pending 
    NodeID: dowdk4pzfzm85zijbo23e6xs3 
    Error: rpc error: code = 2 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. 
    Is Manager: true Node Address: 192.168.99.100 
    Manager Addresses: 
    192.168.99.100:2375 
    192.168.99.102:2377 
Runtimes: runc 
Default Runtime: runc 
Init Binary: docker-init 
containerd version: cfb82a876ecc11b5ca0977d1733adbe58599088a 
runc version: 2d41c047c83e09a6d61d464906feb2a2f3c52aa4 
init version: 949e6fa 
Security Options: 
    seccomp 
    Profile: default 
Kernel Version: 
    4.4.74-boot2docker 
Operating System: Boot2Docker 17.06.0-ce (TCL 7.2); HEAD : 0672754 - Thu Jun 29 00:06:31 UTC 2017 
OSType: linux 
Architecture: x86_64 
CPUs: 1 
Total Memory: 995.8MiB 
Name: first 
ID: ACGX:Z6QQ:5KOX:7W2O:OMMM:43PB:4QES:KKGJ:IXUC:J2SW:F4SJ:QMQ4 
Docker Root Dir: /mnt/sda1/var/lib/docker 
Debug Mode (client): false 
Debug Mode (server): true 
File Descriptors: 24 
Goroutines: 76 
System Time: 2017-07-28T01:57:37.410536525Z 
EventsListeners: 0 
Registry: https://index.docker.io/v1/ 
Labels: provider=virtualbox 
Experimental: false 
Insecure Registries: 
    127.0.0.0/8 
Live Restore Enabled: false 

ん@ SAN的系统 - 产品名称:〜$ docker-机器的ssh第一搬运工网络LS

NETWORK ID   NAME    DRIVER    SCOPE 
    22e85840407d  bridge    bridge    local 
    fc3c6786739c  docker_gwbridge  bridge    local 
    e294dde63753  host    host    local 
    55f8e340b794  none    null    local 

我怎么能解决这个问题,并使用

docker node ls

on manage node?非常感谢您的建议。

+0

我也想知道为什么会发生,如果你知道答案,请填写感觉给我一个评论。 –

回答

1

我有同样的问题,但我不知道是什么原因造成的。我能够通过输入来修复它:

docker swarm init --force-new-cluster 

一切都恢复了。我希望这也适用于你

相关问题