Skip to content
This repository was archived by the owner on Aug 20, 2025. It is now read-only.

Conversation

@nickwallen
Copy link
Contributor

@nickwallen nickwallen commented Feb 6, 2018

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.

screen shot 2018-02-06 at 11 27 34 am

Testing

  1. Launch a development environment; either Ubuntu or CentOS.

    • Ensure that telemetry reaches the Alerts UI.
    • Run the Metron Service Check
  2. 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/
    
  3. 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.
  • 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?
  • 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:

@mmiklavc
Copy link
Contributor

mmiklavc commented Feb 7, 2018

Spinning this up now, merged with #928 to make sure all is well with Ambari 2.6.1. I expect the changes in this PR will not be affected.

@mmiklavc
Copy link
Contributor

mmiklavc commented Feb 7, 2018

+1. This looks great @nickwallen. Thanks for fixing this! Everything spun up with the appropriate mem settings. Modifying the template and heap reflect in the jvm.options and process display.

@asfgit asfgit closed this in 31f3aa8 Feb 7, 2018
@nickwallen
Copy link
Contributor Author

Thanks for the review @mmiklavc and making sure the merge was solid.

k-popov pushed a commit to k-popov/ambari-elasticsearch-metron that referenced this pull request Mar 26, 2018
@nickwallen nickwallen deleted the METRON-1447 branch September 17, 2018 19:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants