나는 사기성 백엔드 (dicovery backend)로 사육사 (Zookeeper)를 사용하여 생산 준비가 완료된 스웜 클러스터를 구축해야합니다. 이 목적을 위해 공식 문서 인 https://docs.docker.com/swarm/install-manual/을 사용했습니다. 백엔드 발견에 관해서 나는 이것을 사용했다 : https://docs.docker.com/swarm/discovery/. 이제 문제가 생겼습니다. 웜과 통신을 시도 할 때 다음 오류가 발생합니다. 선출 된 기본 클러스터 관리자가 없습니다. 내가 내 떼 관리자와 동일한 호스트에서 사육사 3.4.9 출시와 함께, 고정 표시기의 클라이언트/서버 버전 1.12.3와 우분투 16.04에서 실행 해요Docker Swarm with Zookeeper - 선택하지 않은 기본 클러스터 관리자
:
이 내 설정입니다. 온
$ docker run -d -p 4000:4000 swarm manage -H :4000 --replication --advertise <swarm-manager-ip>:4000 zk://<swarm-manager-ip>/swarm
: 나는 떼 관리자에서 지금 하나 떼 관리자와 한 무리 노동자
각 노드에서 부두 노동자 엔진 설치 후 가진 두 개의 노드 아키텍처,
$ nohup docker daemon -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock &
을 사용하고 있습니다 swarm worker :
$ docker run -d swarm join --advertise=<swarm-worker-ip>:2375 zk://<swarm-manager-ip>/swarm
이제 나는 모든 것이 잘되는지 알아보기 위해 아래 명령을 명중했다. 결과는 다음과 같습니다.
$ docker -H <swarm-manager-ip>:4000 ps -a
Error response from daemon: No elected primary cluster manager
난 그냥이 작업을 수행 할 때 :
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
91c3864ba6ee swarm "/swarm manage -H :40" 17 hours ago Up 19 minutes 2375/tcp, 0.0.0.0:4000->4000/tcp swarm-master
나는 떼 마스터를 볼 수 있습니다 내가 떼 노드의 로그를 볼 때,이 볼 수
$ docker logs 91c3864ba6ee
time="2016-12-09T20:29:39Z" level=info msg="Initializing discovery without TLS"
time="2016-12-09T20:29:39Z" level=info msg="Listening for HTTP" addr=":4000" proto=tcp
time="2016-12-09T20:29:39Z" level=info msg="Leader Election: Cluster leadership lost"
2016/12/09 20:29:40 Failed to connect to <swarm-manager-ip>:2181: dial tcp <swarm-manager-ip>:2181: i/o timeout
time="2016-12-09T20:29:40Z" level=error msg="zk: could not connect to a server"
time="2016-12-09T20:29:40Z" level=error msg="zk: could not connect to a server"
time="2016-12-09T20:29:40Z" level=error msg="Discovery error: zk: could not connect to a server"
2016/12/09 20:29:42 Failed to connect to <swarm-manager-ip>:2181: dial tcp <swarm-manager-ip>:2181: i/o timeout
time="2016-12-09T20:29:42Z" level=error msg="Discovery error: zk: could not connect to a server"
2016/12/09 20:29:44 Failed to connect to <swarm-manager-ip>:2181: dial tcp <swarm-manager-ip>:2181: i/o timeout
time="2016-12-09T20:29:44Z" level=error msg="Discovery error: zk: could not connect to a server"
time="2016-12-09T20:29:44Z" level=error msg="Discovery error: Unexpected watch error"
2016/12/09 20:29:46 Failed to connect to <swarm-manager-ip>:2181: dial tcp <swarm-manager-ip>:2181: i/o timeout
2016/12/09 20:29:48 Failed to connect to <swarm-manager-ip>:2181: dial tcp <swarm-manager-ip>:2181: i/o timeout
time="2016-12-09T20:29:50Z" level=info msg="Leader Election: Cluster leadership lost"
2016/12/09 20:29:50 Failed to connect to <swarm-manager-ip>:2181: dial tcp <swarm-manager-ip>:2181: i/o timeout
time="2016-12-09T20:29:50Z" level=error msg="zk: could not connect to a server"
time="2016-12-09T20:29:50Z" level=error msg="zk: could not connect to a server"
을
그러나 간단한 telnet 명령은 내 사육사 호스트가 작동 중임을 보여줍니다. 그래서 동물 애호가 발견 백엔드에 연결하려고 할 때 I/O 타임 아웃이 어떻게됩니까?
당신은 오래된 군대와 일하고 있다는 것을 알고 있습니까? 새 "군집 모드"가 버전 1.12의 도커에 추가되었습니다. 나는 이것이 응용 프로그램 발견 (즉, 사육사가 필요 없음을 의미 함)에 대한 지원을 이미 제공함에 따라이 문제를 조사 할 것을 강력히 권고합니다. –
O'Connor에게 감사드립니다. 나는 갱신 할 것이다. –
Docker 1.12를 실행 중입니다 ... 그렇다면 왜 왜 계속해서 기존 Swarm을 실행하려고합니까? Swarm을 실행하기 위해 더 이상 사육자와 같은 백엔드가 필요하지 않습니다. –