31z4 / zookeeper-docker

Docker image packaging for Apache Zookeeper
MIT License
285 stars 243 forks source link

This ZooKeeper instance is not currently serving requests #83

Closed JiniousChoi closed 4 years ago

JiniousChoi commented 4 years ago

Expected behavior

I ran docker-compose up -d with almost the same docker-compose.yml as yours:

     1  version: '2'
     2  services:
     3    zoo1:
     4      image: library/zookeeper:3.5.6
     5      restart: always
     6      hostname: zoo1
     7      container_name: zoo1
     8      ports:
     9        - 2181:2181
    10      environment:
    11        ZOO_MY_ID: 1
    12        ZOO_SERVERS: server.1=0.0.0.0:2888:3888;2181 server.2=zoo2:2888:3888;2181 server.3=zoo3:2888:3888;2181
    13    zoo2:
    14      image: library/zookeeper:3.5.6
    15      restart: always
    16      hostname: zoo2
    17      container_name: zoo2
    18      ports:
    19        - 2182:2181
    20      environment:
    21        ZOO_MY_ID: 2
    22        ZOO_SERVERS: server.1=zoo1:2888:3888;2181 server.2=0.0.0.0:2888:3888;2181 server.3=zoo3:2888:3888;2181
    23    zoo3:
    24      image: library/zookeeper:3.5.6
    25      restart: always
    26      hostname: zoo3
    27      container_name: zoo3
    28      ports:
    29        - 2183:2181
    30      environment:
    31        ZOO_MY_ID: 3
    32        ZOO_SERVERS: server.1=zoo1:2888:3888;2181 server.2=zoo2:2888:3888;2181 server.3=0.0.0.0:2888:3888;2181

But mostly, one of 3 zk nodes doesn't serve on srvr command via netcat.

Actual behavior

$ docker ps 
CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS              PORTS                                                  NAMES
8517b00c795c        zookeeper:3.5.6       "/docker-entrypoint.…"   7 seconds ago       Up 3 seconds        2888/tcp, 3888/tcp, 0.0.0.0:2181->2181/tcp, 8080/tcp   zoo1
e8449449b29e        zookeeper:3.5.6       "/docker-entrypoint.…"   7 seconds ago       Up 4 seconds        2888/tcp, 3888/tcp, 8080/tcp, 0.0.0.0:2182->2181/tcp   zoo2
ffe1763ed36a        zookeeper:3.5.6       "/docker-entrypoint.…"   7 seconds ago       Up 4 seconds        2888/tcp, 3888/tcp, 8080/tcp, 0.0.0.0:2183->2181/tcp   zoo3
$ echo srvr  | nc localhost 2181
This ZooKeeper instance is not currently serving requests

$ echo srvr  | nc localhost 2182
Zookeeper version: 3.5.6-c11b7e26bc554b8523dc929761dd28808913f091, built on 10/08/2019 20:18 GMT
Latency min/avg/max: 0/0/0
Received: 1
Sent: 0
Connections: 1
Outstanding: 0
Zxid: 0x0
Mode: follower
Node count: 5

$ echo srvr  | nc localhost 2183
Zookeeper version: 3.5.6-c11b7e26bc554b8523dc929761dd28808913f091, built on 10/08/2019 20:18 GMT
Latency min/avg/max: 0/0/0
Received: 1
Sent: 0
Connections: 1
Outstanding: 0
Zxid: 0x100000000
Mode: leader
Node count: 5
Proposal sizes last/min/max: -1/-1/-1

Steps to reproduce the behavior

I just ran docker-compose up -d with the docker-compose.yml on the main README.md

I researched the error message a bit and I found this.

Do you think the docker-compose.yml on README.md of yours needs to be fixed and add some ordering constraints between zk_id 1,2 and 3?

System configuration

Whether I run it on my macos or in ubuntu16, same error for my case :(

31z4 commented 4 years ago

I don't maintain library/zookeeper:3.5.6. Please use the Docker "Official Image" for zookeeper and see if the issue still persists.

MAHashmi commented 4 years ago

@JiniousChoi might be related to https://github.com/31z4/zookeeper-docker/pull/84

JiniousChoi commented 4 years ago

I don't maintain library/zookeeper:3.5.6. Please use the Docker "Official Image" for zookeeper and see if the issue still persists.

Thanks for the reply. BTW, I opened this issue here because the official docker hub page as you refer to in your reply as well brought me here in this repository. Following is a partial screenshot from https://hub.docker.com/_/zookeeper/

Screen Shot 2019-11-13 at 7 59 50 AM

Is it not valid anymore? maybe it needs to be fixed and changed to https://github.com/docker-library/official-images#what-are-official-images ?

31z4 commented 4 years ago

@JiniousChoi sorry, for confusion. I didn't notice that library/zookeeper and zookeeper are the same.

Could you please try what @MAHashmi suggested in #84 and see if it helps?

31z4 commented 4 years ago

Closing it because the issue seems to be inactive for quite some time now.