Comments (5)
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:
- Add
dataDir=/data
into yourzoo.cfg
so thatZOO_MY_ID
will work (recommended). - Set
ZOO_DATA_DIR
env var to/var/lib/zookeeper
. - Put
myid
file into/var/lib/zookeeper
.
from zookeeper-docker.
Hey @jmwilkinson was the issue solved somehow?
from zookeeper-docker.
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.
Alright! So I'm closing this.
from zookeeper-docker.
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)
- Upgrade to JRE 17, pin Ubuntu release HOT 1
- Update jackson-databind to resolve high security vulnerabilities (2.13.1 to 2.13.4.1) HOT 1
- override parent docker image from alpine to ubi8
- Please Publish 3.8.1 HOT 1
- Add s390x to docker official image HOT 1
- with replicas 3, it wont work HOT 1
- Add ppc64le to docker official image HOT 2
- Upgrade to 3.9.0 HOT 1
- Failed to pull image "zookeeper:3.9.0": rpc error: code = NotFound desc = failed to pull and unpack image "docker.io/library/zookeeper:3.9.0": no match for platform in manifest: not found HOT 3
- zookeeper docker 3.9.0 HOT 1
- JSON logging HOT 2
- Zookeeper 3.7.2, 3.8.3 and 3.9.1 tags needed ASAP HOT 2
- Zookeeper switched from log4j to Logback in v3.8.2 HOT 3
- New tag suggestion: stable
- How do I run zookeeper3.7.2 like the official documentation
- Re-releasing Docker images with the same number causes issues HOT 2
- JVM crashes with out of memory HOT 2
- 3.8.4 and 3.9.2 released, will we release new docker tags? HOT 1
- Incorrect default uid/gid HOT 1
- 3.7.2 build failure in docker official images HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zookeeper-docker.