Comments (9)
Hi,
Thanks for the kind words!
You're right, you can't set the env var directly as the service won't see it (as was pointed out to me in #25 (comment)).
The most straightforward way to proceed would be to extend the image using a Dockerfile
like this (untested, so make sure you cross-check the syntax):
FROM sebp/elk
RUN sed -i -e 's#^LS_HEAP_SIZE="500m"$#LS_HEAP_SIZE="1g"#' /etc/init.d/logstash
The idea is that it replaces the LS_HEAP_SIZE
line in Logstash's init file before starting the Logstash service.
As long as I don't touch the LS_HEAP_SIZE="500m"
line in the init file (which I have no foreseeable intention of doing!), you can simply rebuild your image when I publish a new one (hooks might come in handy to automate this) and your image will be aligned with mine in terms of features and bugfixes.
Having said that, I think it would be a good idea to natively expose LS_HEAP_SIZE
as an env var of the image (i.e. have the sed
magic done by the start.sh
at runtime if a LS_HEAP_SIZE
env var has been passed to docker run
), so I'll probably work that feature in the next update. Will add a reference to this issue when I do so that you're automatically notified by GitHub.
from elk-docker.
Thanks!
from elk-docker.
@spujadas, I read your last paragraph again. Why would you want the start.sh to perform sed magic instead of just changing logstash-init so it checks if the env var is defined and act upon it?
from elk-docker.
Because it turns out that services don't see env vars (apart from a select few), so some trickery is needed to feed them to the services.
from elk-docker.
Hmm, didn't know that.
BTW, the correct command is:
sed -i -e 's/LS_HEAP_SIZE=\"500m\"/LS_HEAP_SIZE=\"1g\"/g' /etc/init.d/logstash
explanations:
-i : replace in file (and not in another file)
-e : 's/string1/string2/g' - replace 'string1' with 'string2' on all occurances
from elk-docker.
Cheers.
from elk-docker.
Thanks for this! I've been struggling to up the ES heap size or max mem size as well. I'll try the sed trick until you figure out how to wedge those env vars in there!
Great project!
from elk-docker.
Eventually for me it didn't do the trick. Even setting it up to 2g still OOM after a while.. Something is leaking bad there..
from elk-docker.
@kenwdelong Thanks. Just pushed the update, had postponed it in the hope of releasing it at the same time as a new version of Elasticsearch, Logstash or Kibana, but by popular demand 😄 here it is.
@tallavi Haven't heard about memory leak issues with Logstash in the default image, so may be Logstash-related (had a brief look at https://github.com/elastic/logstash/search?p=1&q=memory+leak&type=Issues&utf8=%E2%9C%93 there might be some things to look into).
Closing this issue following commit c731456
from elk-docker.
Related Issues (20)
- Can't get Elk started HOT 7
- cannot add login page to kibana HOT 1
- How to use environment variable in 30-output.conf file HOT 2
- ELK fails to start on MAC M1 HOT 8
- Setting up APM question HOT 4
- Question: user authentication for https HOT 1
- Error in Security section HOT 1
- Issues installing on TrueNAS Scale HOT 1
- Update ELK to latest version (currently 8.3.3) HOT 4
- Issues running on AWS Fargate HOT 2
- Add sample docker-compose.yml with persistance + traefik configuration HOT 1
- example using image never starts as elasticsearch doesn't start HOT 1
- Kibana refuses connection, nothing in logs HOT 2
- filebeat x509 certificate signed by unknown authority when calling api endpoint HOT 1
- Kibana enrollement token
- Update ELK to 8.9.0 HOT 1
- Kibana 8.11.1 Security Update (ESA-2023-25) HOT 1
- want to move data from this running stack to another machine (arm64-amd64) how to
- how to disable the features that require a licence.
- Please update to 8.13.2 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 elk-docker.