2017-07-27 55 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 

一切都恢復了。我希望這也適用於你

相關問題