Giter VIP home page Giter VIP logo

Comments (6)

Jesse-Cameron avatar Jesse-Cameron commented on September 25, 2024

I've added a quick PR and tested on my machine.
Can confirm that it worked for all three supported versions.

Let me know what you think! 🔥

from zookeeper-docker.

31z4 avatar 31z4 commented on September 25, 2024

Hey @Jesse-Cameron! Sorry for the delay and thanks for reporting this!
ZOO_DATA_LOG_DIR is meant for the transaction log, not the regular service logs. It's used to pass the value to the docker-entrypoint.sh and write it to the config file here.

By default all Zookeeper logs go to the standard output in this image, so you should not bother about reading the logs from $ZOOKEEPER_PREFIX/logs. But if you really want to you may want to check this PR which wasn't finished by the author.

But again, when running in Docker it's common practice to redirect all logs to the standard output and then gather/aggregate those logs with special drivers and tools.

from zookeeper-docker.

Jesse-Cameron avatar Jesse-Cameron commented on September 25, 2024

Hi Elisey,

Thanks for getting back to me. Great to hear your thoughts on the repo. I totally agree that for the most part that docker containers should redirect all logs to stdout. Makes things much easier downstream. I also didn't realised that ZOO_DATA_LOG_DIR was a transactional dir. Good to know.

However, in my experience with zk, not having ZOO_LOG_DIR gives rise to another issue. That, for whatever reason, it needs to be configured in order to write the data/zookeeper.pid file. If you ever want to issue graceful shutdowns (via zkServer.sh stop) this file is required.

I understand that this is your repo and it's up to you, but I would like to suggest is that:

  1. Both ZOO_DATA_LOG_DIR and ZOO_LOG_DIR are set. Potentially renamed to avoid confusion.
  2. The logs in ZOO_LOG_DIR be piped through to stdout via tail -f or some other utility.

Looking forward to hearing your thoughts,
Jesse

from zookeeper-docker.

31z4 avatar 31z4 commented on September 25, 2024

Jesse,

However, in my experience with zk, not having ZOO_LOG_DIR gives rise to another issue. That, for whatever reason, it needs to be configured in order to write the data/zookeeper.pid file. If you ever want to issue graceful shutdowns (via zkServer.sh stop) this file is required.

I'm not sure I understand how ZOO_LOG_DIR could affect zookeeper.pid. The default location of this file is $ZOO_DATADIR/zookeeper_server.pid. Moreover, since we start Zookeeper in foreground, this file is not needed. And when you stop the container SIGTERM is sent to the process, which is exactly what zkServer.sh stop does. So stoppping the container equals gracefull shutdown.

Both ZOO_DATA_LOG_DIR and ZOO_LOG_DIR are set. Potentially renamed to avoid confusion.

As I mentioned earlier you could take a look at this PR and try to resurect it.

The logs in ZOO_LOG_DIR be piped through to stdout via tail -f or some other utility.

This looks like a bit of a hack. I think a proper way of doing this would be via log4j.

from zookeeper-docker.

hlwanghl avatar hlwanghl commented on September 25, 2024

@Jesse-Cameron ZOO_LOG_DIR was introduced recently, and you can take a look here:
https://github.com/31z4/zookeeper-docker#how-to-configure-logging

from zookeeper-docker.

Jesse-Cameron avatar Jesse-Cameron commented on September 25, 2024

@hlwanghl Thanks for the update! Excited to try this out! 👍

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.