Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange port issue when using 3.5 with docker-compose #65

Closed
aiqingyuyan opened this issue May 29, 2019 · 2 comments
Closed

Strange port issue when using 3.5 with docker-compose #65

aiqingyuyan opened this issue May 29, 2019 · 2 comments
Assignees
Labels

Comments

@aiqingyuyan
Copy link

Not sure if it's just my problem or not. I am using the provided docker-compose.yml example in the documentation. When I started on local, all 3 containers started up, but when I went into containers themselves and ran ./zkServer.sh status, all of them gave me the following output:

ZooKeeper JMX enabled by default
Using config: /conf/zoo.cfg
Client port not found in static config file. Looking in dynamic config file.
grep: : No such file or directory
Client port not found. Terminating.

zookeeper cannot start

But then when I switch zookeeper version to 3.4, everything works perfectly, zookeeper starts correctly, I can connect to each of the node using zkCli.sh

Expected behavior

Using the provided docker-compose.yml example with zookeeper:3.5 on local, zookeeper should start correctly, no port issue

Actual behavior

Cannot find port

Steps to reproduce the behavior

  1. Using the following compose file
version: '3.1'

services:
  zoo1:
    image: zookeeper:3.5
    restart: always
    hostname: zoo1
    ports:
      - 2181:2181
    environment:
      ZOO_MY_ID: 1
      ZOO_SERVERS: server.1=0.0.0.0:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888

  zoo2:
    image: zookeeper:3.5
    restart: always
    hostname: zoo2
    ports:
      - 2182:2181
    environment:
      ZOO_MY_ID: 2
      ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=0.0.0.0:2888:3888 server.3=zoo3:2888:3888

  zoo3:
    image: zookeeper:3.5
    restart: always
    hostname: zoo3
    ports:
      - 2183:2181
    environment:
      ZOO_MY_ID: 3
      ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=0.0.0.0:2888:3888

and run docker-compose up -d

  1. Go into any of the containers, then cd to bin folder, and ran ./zkServer.sh status

System configuration

MacBook Pro
Intel Core i7
Memory: 16 GB

@skydivervrn
Copy link

skydivervrn commented May 30, 2019

HI all.
I have same issue.

8:/apache-zookeeper-3.5.5-bin# cat /conf/zoo.cfg
dataDir=/data
dataLogDir=/datalog
tickTime=2000
initLimit=5
syncLimit=2
autopurge.snapRetainCount=3
autopurge.purgeInterval=0
maxClientCnxns=60
standaloneEnabled=true
server.1=zoo1:2888:3888
server.2=0.0.0.0:2888:3888
server.3=zoo3:2888:3888

Without clientPort=2181

@31z4 31z4 self-assigned this Jun 2, 2019
@31z4 31z4 added the bug label Jun 2, 2019
@31z4 31z4 closed this as completed in c3c51b1 Jun 2, 2019
@31z4
Copy link
Owner

31z4 commented Jun 2, 2019

Hello guys and thanks for reporting this! 👍

The issue is that the client port part is missing in ZOO_SERVERS. E.g., for zoo1 it should have been ZOO_SERVERS: server.1=0.0.0.0:2888:3888;2181 server.2=zoo2:2888:3888;2181 server.3=zoo3:2888:3888;2181.

I updated the stack.yml example accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants
@31z4 @aiqingyuyan @skydivervrn and others