Giter VIP home page Giter VIP logo

Comments (5)

31z4 avatar 31z4 commented on September 26, 2024

Thank you for your report @jmwilkinson
ZOO_MY_ID works just fine out of the box.

$ docker run -it --rm -e ZOO_MY_ID=1 zookeeper
ZooKeeper JMX enabled by default
Using config: /conf/zoo.cfg
2017-05-19 09:49:58,486 [myid:] - INFO  [main:QuorumPeerConfig@134] - Reading configuration from: /conf/zoo.cfg
2017-05-19 09:49:58,494 [myid:] - INFO  [main:DatadirCleanupManager@78] - autopurge.snapRetainCount set to 3
2017-05-19 09:49:58,495 [myid:] - INFO  [main:DatadirCleanupManager@79] - autopurge.purgeInterval set to 0
2017-05-19 09:49:58,495 [myid:] - INFO  [main:DatadirCleanupManager@101] - Purge task is not scheduled.
2017-05-19 09:49:58,496 [myid:] - WARN  [main:QuorumPeerMain@113] - Either no config or no quorum defined in config, running  in standalone mode
2017-05-19 09:49:58,511 [myid:] - INFO  [main:QuorumPeerConfig@134] - Reading configuration from: /conf/zoo.cfg
2017-05-19 09:49:58,512 [myid:] - INFO  [main:ZooKeeperServerMain@96] - Starting server
2017-05-19 09:49:58,524 [myid:] - INFO  [main:Environment@100] - Server environment:zookeeper.version=3.4.10-39d3a4f269333c922ed3db283be479f9deacaa0f, built on 03/23/2017 10:13 GMT
2017-05-19 09:49:58,524 [myid:] - INFO  [main:Environment@100] - Server environment:host.name=216c7e8477ef
2017-05-19 09:49:58,524 [myid:] - INFO  [main:Environment@100] - Server environment:java.version=1.8.0_121
2017-05-19 09:49:58,526 [myid:] - INFO  [main:Environment@100] - Server environment:java.vendor=Oracle Corporation
2017-05-19 09:49:58,531 [myid:] - INFO  [main:Environment@100] - Server environment:java.home=/usr/lib/jvm/java-1.8-openjdk/jre
2017-05-19 09:49:58,532 [myid:] - INFO  [main:Environment@100] - Server environment:java.class.path=/zookeeper-3.4.10/bin/../build/classes:/zookeeper-3.4.10/bin/../build/lib/*.jar:/zookeeper-3.4.10/bin/../lib/slf4j-log4j12-1.6.1.jar:/zookeeper-3.4.10/bin/../lib/slf4j-api-1.6.1.jar:/zookeeper-3.4.10/bin/../lib/netty-3.10.5.Final.jar:/zookeeper-3.4.10/bin/../lib/log4j-1.2.16.jar:/zookeeper-3.4.10/bin/../lib/jline-0.9.94.jar:/zookeeper-3.4.10/bin/../zookeeper-3.4.10.jar:/zookeeper-3.4.10/bin/../src/java/lib/*.jar:/conf:
2017-05-19 09:49:58,533 [myid:] - INFO  [main:Environment@100] - Server environment:java.library.path=/usr/lib/jvm/java-1.8-openjdk/jre/lib/amd64/server:/usr/lib/jvm/java-1.8-openjdk/jre/lib/amd64:/usr/lib/jvm/java-1.8-openjdk/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
2017-05-19 09:49:58,533 [myid:] - INFO  [main:Environment@100] - Server environment:java.io.tmpdir=/tmp
2017-05-19 09:49:58,533 [myid:] - INFO  [main:Environment@100] - Server environment:java.compiler=<NA>
2017-05-19 09:49:58,535 [myid:] - INFO  [main:Environment@100] - Server environment:os.name=Linux
2017-05-19 09:49:58,535 [myid:] - INFO  [main:Environment@100] - Server environment:os.arch=amd64
2017-05-19 09:49:58,535 [myid:] - INFO  [main:Environment@100] - Server environment:os.version=4.9.27-moby
2017-05-19 09:49:58,535 [myid:] - INFO  [main:Environment@100] - Server environment:user.name=zookeeper
2017-05-19 09:49:58,536 [myid:] - INFO  [main:Environment@100] - Server environment:user.home=/home/zookeeper
2017-05-19 09:49:58,536 [myid:] - INFO  [main:Environment@100] - Server environment:user.dir=/zookeeper-3.4.10
2017-05-19 09:49:58,545 [myid:] - INFO  [main:ZooKeeperServer@829] - tickTime set to 2000
2017-05-19 09:49:58,546 [myid:] - INFO  [main:ZooKeeperServer@838] - minSessionTimeout set to -1
2017-05-19 09:49:58,546 [myid:] - INFO  [main:ZooKeeperServer@847] - maxSessionTimeout set to -1
2017-05-19 09:49:58,577 [myid:] - INFO  [main:NIOServerCnxnFactory@89] - binding to port 0.0.0.0/0.0.0.0:2181

From what I see in your logs it tries to find myid in /var/lib/zookeeper which probably means you use a custom config file. But the value from ZOO_MY_ID is written into $ZOO_DATA_DIR/myid by default. Where ZOO_DATA_DIR equals /data by default.

You can probably solve the issue in three different ways:

  1. Add dataDir=/data into your zoo.cfg so that ZOO_MY_ID will work (recommended).
  2. Set ZOO_DATA_DIR env var to /var/lib/zookeeper.
  3. Put myid file into /var/lib/zookeeper.

from zookeeper-docker.

31z4 avatar 31z4 commented on September 26, 2024

Hey @jmwilkinson was the issue solved somehow?

from zookeeper-docker.

jmwilkinson avatar jmwilkinson commented on September 26, 2024

Hey @31z4

Sorry for the delayed response.

I already had the dataDir specified in my config (pointing to a non-default location). I solved the problem by writing the id directly to the myid file, and then starting zookeeper.

from zookeeper-docker.

31z4 avatar 31z4 commented on September 26, 2024

Alright! So I'm closing this.

from zookeeper-docker.

jmwilkinson avatar jmwilkinson commented on September 26, 2024

Ok. To be clear, this is still a bug somewhere- though perhaps with zookeeper and not the docker build.

from zookeeper-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.