GitHub user nickwallen opened a pull request: https://github.com/apache/metron/pull/927
METRON-1447 Heap Size Not Set Correctly by MPack for ES 5.x The preferred way in which the heap size and other JVM options are set changed between ES 2.x and ES 5.x. The project upgraded to ES 5.x as part of #840 , but the way the heap size is set by the Mpack was not changed. This resulted in the heap size for Elasticsearch to be set incorrectly. This also allows Elasticsearch to use up to 2G of heap when launched in the development environments, which is too much for a constrained single VM. ## Changes The user can set the heap size by populating the "heap_size" field under "Advanced elastic-jvm-options" in Ambari. Elasticsearch also exposes a large number of other settings in this file. The entire content of the file was exposed in Ambari to allow users to also alter any other JVM options as needed.  ## Testing 1. Launch a development environment; either Ubuntu or CentOS. * Ensure that telemetry reaches the Alerts UI. * Run the Metron Service Check * Run the Elasticsearch Service Check 1. Login to the node and ensure that only a single `-Xms` and `-Xmx` option was passed to the JVM when launching Elasticsearch. Ensure these are both set to the default heap size of 512mb. ``` root@node1:/etc/elasticsearch# ps -ef | grep Elastic root 1084 31038 0 16:09 pts/4 00:00:00 grep --color=auto Elastic elastic+ 30048 1 23 16:08 ? 00:00:17 /usr/jdk64/jdk1.8.0_112/bin/java -Xms512m -Xmx512m -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -server -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -Djdk.io.permissionsUseCanonicalPath=true -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j.skipJansi=true -XX:+HeapDumpOnOutOfMemoryError -Des.path.home=/usr/share/elasticsearch -cp /usr/share/elasticsearch/lib/* org.elasticsearch.bootstrap.Elasticsearch -d -p /var/run/elasticsearch/elasticsearch.pid -Edefault.path.logs=/var/log/elasticsearch -Edefault.path.data=/var/lib/elasticsearch/ -Edefault.path.conf=/etc/elasticsearch/ ``` 1. Alter the JVM options template, save the settings, restart Elasticsearch, and ensure that the changes are reflected in the `/etc/elasticsearch/jvm.options` file. ## Pull Request Checklist - [ ] Is there a JIRA ticket associated with this PR? If not one needs to be created at [Metron Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel). - [ ] Does your PR title start with METRON-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. - [ ] Has your PR been rebased against the latest commit within the target branch (typically master)? - [ ] Have you included steps to reproduce the behavior or problem that is being changed or addressed? - [ ] Have you included steps or a guide to how the change may be verified and tested manually? - [ ] Have you ensured that the full suite of tests and checks have been executed in the root metron folder via: - [ ] Have you written or updated unit tests and or integration tests to verify your changes? - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? - [ ] Have you verified the basic functionality of the build by building and running locally with Vagrant full-dev environment or the equivalent? - [ ] Have you ensured that format looks appropriate for the output in which it is rendered by building and verifying the site-book? If not then run the following commands and the verify changes via `site-book/target/site/index.html`: You can merge this pull request into a Git repository by running: $ git pull https://github.com/nickwallen/metron METRON-1447 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/metron/pull/927.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #927 ---- commit 4224bfaa44ac0ad1512e7b4e13f77769c8708f32 Author: Nick Allen <nick@...> Date: 2018-02-06T16:14:15Z METRON-1447 Heap Size Not Set Correctly by MPack for ES 5.x ---- ---