{"action":"created","issue":{"url":"https://api.github.com/repos/docker/swarm/issues/1491","repository_url":"https://api.github.com/repos/docker/swarm","labels_url":"https://api.github.com/repos/docker/swarm/issues/1491/labels{/name}","comments_url":"https://api.github.com/repos/docker/swarm/issues/1491/comments","events_url":"https://api.github.com/repos/docker/swarm/issues/1491/events","html_url":"https://github.com/docker/swarm/issues/1491","id":120126769,"number":1491,"title":"Swarm Master and Replica No elected primary cluster manager error.","user":{"login":"ankitsnlq","id":7347629,"avatar_url":"https://avatars.githubusercontent.com/u/7347629?v=3","gravatar_id":"","url":"https://api.github.com/users/ankitsnlq","html_url":"https://github.com/ankitsnlq","followers_url":"https://api.github.com/users/ankitsnlq/followers","following_url":"https://api.github.com/users/ankitsnlq/following{/other_user}","gists_url":"https://api.github.com/users/ankitsnlq/gists{/gist_id}","starred_url":"https://api.github.com/users/ankitsnlq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ankitsnlq/subscriptions","organizations_url":"https://api.github.com/users/ankitsnlq/orgs","repos_url":"https://api.github.com/users/ankitsnlq/repos","events_url":"https://api.github.com/users/ankitsnlq/events{/privacy}","received_events_url":"https://api.github.com/users/ankitsnlq/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/swarm/labels/area/API","name":"area/API","color":"fbca04"},{"url":"https://api.github.com/repos/docker/swarm/labels/area/replication","name":"area/replication","color":"fbca04"},{"url":"https://api.github.com/repos/docker/swarm/labels/area/store","name":"area/store","color":"fbca04"},{"url":"https://api.github.com/repos/docker/swarm/labels/kind/bug","name":"kind/bug","color":"207de5"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-12-03T09:29:17Z","updated_at":"2016-04-19T01:24:09Z","closed_at":"2016-01-05T19:14:14Z","body":"I have two swarm manager, one is primary and another one is replica for it . But some time Master swarm gets role Replica and in primary row it's show self ip address as primary.I'm using consul for master election.\r\n\r\nHere is what i get after ```docker info```\r\n\r\n```\r\nContainers: 26\r\nImages: 25\r\nRole: replica\r\nPrimary: 172.16.0.197:4000\r\nStrategy: spread\r\nFilters: health, port, dependency, affinity, constraint\r\nNodes: 2\r\n arun-Latitude-3550: 172.16.0.247:2375\r\n  └ Containers: 17\r\n  └ Reserved CPUs: 0 / 4\r\n  └ Reserved Memory: 0 B / 8.099 GiB\r\n  └ Labels: executiondriver=native-0.2, kernelversion=3.13.0-68-generic, operatingsystem=Ubuntu 14.04.3 LTS, storagedriver=aufs\r\n raw1-VirtualBox: 172.16.0.236:2375\r\n  └ Containers: 9\r\n  └ Reserved CPUs: 0 / 1\r\n  └ Reserved Memory: 0 B / 3.086 GiB\r\n  └ Labels: executiondriver=native-0.2, aContainers: 26\r\n```\r\nIn the output we can see it is shwoing Replica but if you see the primary Ip line it is showing own ip address. So it got Role as Replica and even if it is primary. \r\n\r\nOutput of ```ip r l``` command\r\n\r\n```\r\ndefault via 172.16.0.1 dev eth0  proto static \r\n172.16.0.0/23 dev eth0  proto kernel  scope link  src 172.16.0.197  metric 1 \r\n172.17.0.0/16 dev docker0  proto kernel  scope link  src 172.17.0.1\r\n```\r\n\r\nIn that situation if i give command to swarm manager it will show me ```docker ps ```\r\n\r\n````\r\nError response from daemon: No elected primary cluster manager\r\n\r\n```\r\n\r\nAfter some time issue gets resolved and i get Role as Primary and docker ps command start working . \r\n\r\nBut after giving command  ```docker ps -a```\r\n\r\n``` An error occurred trying to connect: Get http://0.0.0.0:4000/v1.21/containers/json?all=1: EOF ```\r\n"},"comment":{"url":"https://api.github.com/repos/docker/swarm/issues/comments/211672420","html_url":"https://github.com/docker/swarm/issues/1491#issuecomment-211672420","issue_url":"https://api.github.com/repos/docker/swarm/issues/1491","id":211672420,"user":{"login":"abronan","id":1655859,"avatar_url":"https://avatars.githubusercontent.com/u/1655859?v=3","gravatar_id":"","url":"https://api.github.com/users/abronan","html_url":"https://github.com/abronan","followers_url":"https://api.github.com/users/abronan/followers","following_url":"https://api.github.com/users/abronan/following{/other_user}","gists_url":"https://api.github.com/users/abronan/gists{/gist_id}","starred_url":"https://api.github.com/users/abronan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abronan/subscriptions","organizations_url":"https://api.github.com/users/abronan/orgs","repos_url":"https://api.github.com/users/abronan/repos","events_url":"https://api.github.com/users/abronan/events{/privacy}","received_events_url":"https://api.github.com/users/abronan/received_events","type":"User","site_admin":false},"created_at":"2016-04-19T01:24:09Z","updated_at":"2016-04-19T01:24:09Z","body":"@EamonZhang Oh I actually missed that piece of logs, but `level=error msg=\"client: etcd cluster is unavailable or misconfigured` suggests that the manager can't connect to the etcd server somehow through the client, are you using any kind of special setup for your etcd cluster, like Proxy mode or else?\r\n"}}