I have setup the ELK stack with Docker and I am using the 6.4.0 version of the same, with Docker version 18.06.0-ce, build 0ffa825.
The docker compose file for the Elasticsearch is
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTIC_VERSION}
volumes:
- "./elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro"
- "./esdata:/usr/share/elasticsearch/data"
ports:
- "${ELASTICSEARCH_HTTP_PORT}:${ELASTICSEARCH_HTTP_PORT}"
- "${ELASTICSEARCH_TCP_PORT}:${ELASTICSEARCH_TCP_PORT}"
environment:
ES_JAVA_OPTS: "-Xmx2g -Xms2g"
cluster.name: ${ELASTICSEARCH_CLUSTER_NAME}
network.publish_host: ${HOSTNAME}
transport.tcp.port: ${ELASTICSEARCH_TCP_PORT}
http.port: ${ELASTICSEARCH_HTTP_PORT}
discovery.zen.ping.unicast.hosts: ${HOSTNAME}
env_file:
- .env
networks:
- elk
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
When I start the docker I see 2 Xms and Xmx values in the log and hence the heap size is not set right.
elasticsearch_1 | [2018-09-23T12:19:50,585][INFO ][o.e.n.Node ] [3J9Iack] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/tmp/elasticsearch.0FKS2YNh, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m, -Djava.locale.providers=COMPAT, -XX:UseAVX=2, -Des.cgroups.hierarchy.override=/, -Xmx2g, -Xms2g, -Des.path.home=/usr/share/elasticsearch, -Des.path.conf=/usr/share/elasticsearch/config, -Des.distribution.flavor=default, -Des.distribution.type=tar]
Please help me fix it.
Thank you