-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ruby function to merge JVM options #23
Conversation
Fixes #22 Right now using `deep_merge` results in the JVM options array being overwritten completely. The default options added since updating this module to use elasticstack and Java 11 result in the service not being able to start depending on the version of Elasticsearch selected. This ensures that the default JVM options are scoped to the Java versions they work with and that any overrides do not cause these safe defaults to be overwritten completely unless it is intentional. The update is backwards compatible with installations that set the `-Xmx` and `-Xms` JVM options using the legacy method and adds a new simpler option `memory` that will set these options for you.
My first test with the following config failed:
The logs show that it's because of the following error:
|
Well that’s not right! From a clean install? I’ll try it again. |
Yeah that was from a fresh install and I also tried a provision as well. It was still getting the defaults from the ES puppet class. |
The switch to using `include ::java` meant that the package declaration to remove it was declaring a duplicate resource. This just leaves Java installed instead as the main thing is that ES is removed.
Herp derp - if you passed no Tested and this works now with the following: extensions:
- chassis/chassis_elasticsearch
elasticsearch:
repo_version: 6.x
version: 6.3.1
plugins: [analysis-icu, ingest-attachment]
virtualbox:
memory: 2048 and extensions:
- chassis/chassis_elasticsearch
elasticsearch:
repo_version: 6.x
version: 6.3.1
plugins: [analysis-icu, ingest-attachment]
memory: 1024
virtualbox:
memory: 2048 and extensions:
- chassis/chassis_elasticsearch
elasticsearch:
jvm_options:
- '-Xmx512m'
- '-Xms512m' |
@@ -11,9 +11,6 @@ | |||
class { 'elasticsearch': | |||
ensure => 'absent' | |||
} | |||
package { 'java-common': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference this was breaking using the disabled_extensions
feature with this extension
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oohh let me dig into this one and open an issue to fix it! Thanks for letting me know!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one! We're back in action now. Thank you Sir!
Fixes #22
Right now using
deep_merge
results in the JVM options array being overwritten completely. The default options added since updating this module to use elasticstack and Java 11 result in the service not being able to start depending on the version of Elasticsearch selected.This ensures that the default JVM options are scoped to the Java versions they work with and that any overrides do not cause these safe defaults to be overwritten completely unless it is intentional.
The update is backwards compatible with installations that set the
-Xmx
and-Xms
JVM options using the legacy method and adds a new simpler optionmemory
that will set these options for you.