Giter VIP home page Giter VIP logo

Comments (4)

spujadas avatar spujadas commented on May 26, 2024

touch: cannot touch '/data/log/logstash/logstash.log': No such file or directory
chown: cannot access '/data/log/logstash/logstash.log': No such file or directory
[root@log /]# /usr/local/bin/logstash: line 57: /data/log/logstash/logstash.stdout: No such file or directory

As you changed the LS_LOG_DIR environment variable to /data/log/logstash, in your Dockerfile you need to create the /data/log/logstash directory and make it writable by the logstash user (which the Logstash service should run as). You want something like:

mkdir -p /data/log/logstash
chown logstash:logstash /data/log/logstash

[root@log /]# /usr/local/bin/logstash start

I'd recommend using:

  • either the service logstash start (with the original logstash-init file copied to /etc/init.d/logstash as in the initial Dockerfile) to make sure that the environment is set up correctly and that the proper arguments are passed to logstash (and that Logstash is started as logstash rather than root);
  • or – if you don't want to use an init file and want to start Logstash manually instead – something more along the lines of logstash agent -f ${LS_CONF_DIR} -l ${LS_LOG_FILE} ${LS_OPTS} > "${LS_LOG_DIR}/$name.stdout" 2> "${LS_LOG_DIR}/$name.err" & (as in the init file, making sure that you've also populated JAVA_OPTS and the rest of the environment variables).

Let me know if that works out for you.

Oh, and from the output:

logstash started.

Seems that Logstash did start and may actually be running 😃 (despite not being able to write out its logs or its stdout/stderr due to the missing directory).

from elk-docker.

meepor avatar meepor commented on May 26, 2024

@spujadas
Thanks for the comprehensive instructions. Much appreciated.

It works like a charm!

[root@log /]# /etc/init.d/logstash status
logstash is running

from elk-docker.

meepor avatar meepor commented on May 26, 2024

Client logs forwarded to the elk host, is stored on the elk?
If so, you need to make a mount volumes to the host,What do you think?

from elk-docker.

spujadas avatar spujadas commented on May 26, 2024

Glad to hear that you got it working!

As for maintaining the logs across restarts, you might want to take a look at Making log data persistent, which explains how to create a Docker data volume in the ELK container.

Other options include:

  • bind mounting the /var/lib/elasticsearch directory in the container to a directory on the host (e.g. docker run ... -v /some/dir/on/host:/var/lib/elasticsearch ...);
  • adding a VOLUME /var/lib/elasticsearch instruction in the Dockerfile. I'll probably do that in the very near future to make the log data persistent by default in the image.

Hope that helps.

from elk-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.