elastic / elasticsearch-docker

Official Elasticsearch Docker image
Apache License 2.0
789 stars 240 forks source link

Can't set ES_JAVA_OPTS #239

Closed pulpbill closed 5 years ago

pulpbill commented 5 years ago

This is my docker-compose:

nginx:
  image: nginx:alpine
  container_name: nginx
  command: nginx -g "daemon off;"
  volumes:
  - ./nginx/config/conf.d:/etc/nginx/conf.d
  ports:
    - "8080:8080"
  links:
    - kibana

elasticsearch:
  image: elasticsearch:latest
  container_name: elasticsearch
#  image: elasticsearch:2.4.6-alpine
  command: elasticsearch
# -Ees.network.host=0.0.0.0
  environment:
    ES_JAVA_OPTS: -Xms6g -Xmx6g

  volumes:
    - ./elasticsearch/storage:/usr/share/elasticsearch/data
  ports:
    - "9200:9200"
    - "9300:9300"

logstash:
  build: logstash/
  command: logstash -f /etc/logstash/conf.d/logstash.conf
  container_name: logstash
  environment:
    - "LS_JAVA_OPTS=-Xmx256m -Xms256m"

  volumes:
    - ./logstash/config:/etc/logstash/conf.d
  ports:
    - "5000:5000"
    - "5044:5044"
  links:
    - elasticsearch
kibana:
  build: kibana/
  container_name: kibana
  volumes:
    - ./kibana/config:/opt/kibana/config
  ports:
    - "5601:5601"
  links:
    - elasticsearch

I've been trying to set jvm heap size to 6g (or anything for what matters) but couldn't, I checked previous issues, tried moving values around and same result. While running top at docker host I just got -Xms2g -Xmx2g same for /etc/elasticsearch/jvm.options file inside ES container. And, eventually, this container crashes due to lack of jvm heap size. That's why I'm trying to increase it.

What am I doing worng? Thanks!

dliappis commented 5 years ago

@pulpbill elasticsearch:2.4.6-alpine isn't a version that was created from Elastic and this repo. Please refer to https://www.docker.elastic.co/# for the list of the official Docker images. See also https://github.com/elastic/elasticsearch-docker/issues/215#issuecomment-456816727

pulpbill commented 5 years ago

Thanks! I was thinking of the image not beeing managed by this repo on my way to work haha. I'm gonna try using another valid one since most people had it working by just setting the environment variable as ES_JAVA_OPTS.