-
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
Setting JVM Options Prevents Elasticsearch from Loading #22
Comments
Hey @mikeselander, thanks again for the bug report Sir! I can confirm that I can replicate this. I'm actually not sure if the custom JVM options ever worked as I didn't write the original extension. I can have a look at getting them to work though! |
That would be amazing, thank you! I also have a question related to these/YAML question: jvm_options:
- "-Xms2024m"
- "-Xmx2024m" jvm_options: ["-Xms2024m", "-Xmx2024m"] |
Yeah that's correct about the syntax! I've just started doing some digging. A |
Alrighty, so here's what I've discovered. @roborourke has used a
However, if you only do that then you're still not gonna get a provision to work successfully because the default VM memory in Chassis is only If you do the following then you should get a successful provision:
N.B. You'll need to do a |
Isn’t the point of a deep_merge that you’d only need to pass in overrides? I’m sure that was working so are we positive it wasn’t just the available VM memory that was the issue? In addition you should ideally give the VM twice as much much memory as you give to ES as it still has to run all the other services |
I'm going to dig into this today FYI to try and see what changed, as the extension was definitely working previously. |
It was, the changes initially were just to hide some warnings I think. Fwiw a clean install and provision of Altis v3 works fine so I’m hoping it was just the VM memory being the issue |
The issue is def the unrecognised parameters in the logs we have; specifically:
I can confirm that the following configuration (Altis' default) works just fine: elasticsearch:
plugins: [analysis-icu, ingest-attachment] As @mikeselander notes, setting the jvm_options breaks it. However, the bug appears to be a bit more insidious than one might think. What's actually happening is that ES appears to be adding defaults into the options. The custom settings provided by this extension with no overrides generate this file at
However, with the overrides, it produces:
This is occurring due to the defaults that exist in the ES module. Essentially, unless you manually specify the correct option here, it will automatically add a broken option for you. That means changing the options in the Chassis ES manifest won't help; you need to explicitly set them somewhere. Great usability from puppet-elasticsearch there 👍 (See also voxpupuli/puppet-elasticsearch#1032) Setting all the settings manually will likely work; as @BronsonQuick notes though, you also need to restart the machine if you're bumping the machine's RAM settings. Applying the changes causes ES to fail starting otherwise, but with a different error that you can miss if you're not watching closely:
After rebooting the machine, So, to summarise:
The following configuration should work: elasticsearch:
jvm_options:
# Bump memory for ES to 2GB
- "-Xms2024m"
- "-Xmx2024m"
# Include defaults for ES
- "8:-XX:NumberOfGCLogFiles=32"
- "8:-XX:GCLogFileSize=64m"
- "8:-XX:+UseGCLogFileRotation"
- "8:-XX:+PrintTenuringDistribution"
- "8:-XX:+PrintGCDateStamps"
- "8:-XX:+PrintGCApplicationStoppedTime"
- "8:-XX:+UseConcMarkSweepGC"
- "8:-XX:+UseCMSInitiatingOccupancyOnly"
- "-XX:+UseG1GC"
- "11:-XX:InitiatingHeapOccupancyPercent=75"
# Bump VM memory as well
virtualbox:
memory: 4048
cpus: 2 We should document this. |
Ah I see regarding the |
For testing btw, here's the key things you need:
If you miss any of these steps, you can run into false positives and negatives super easy. |
@BronsonQuick @rmccue what are your thoughts on providing the full default jvm_options list but also having a new config option to set the memory limit and use that to generate the |
@roborourke You read my mind, I think that's the best option here. |
Ah, had not considered the memory issue! Thanks gents. |
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.
Ok, created #23 to fix this finally - it ensures the defaults we added are always there but still allows overriding via It's backwards compatible and also adds a new Would appreciate it if you have a chance to test it out @mikeselander I think another good improvement would be to try and warn or throw an error if the VM memory is not sufficient, would require parsing the size out of the |
Elasticsearch will not start up any longer when setting any JVM options. It doesn't seem to matter what JVM options are set, the act of setting them at all prevents Elasticsearch from loading in the same manner as #20.
For good measure, I also tested this by setting only the
chassis/chassis_elasticsearch
extension on a Chassis Quickstart install and it also failed.The following configurations do and don't work:
Works:
Does not work:
For this next one, I figured that setting the new JVM options might solve the problem, but I got no such luck.
Does not work:
What operating system do you use?
OSX Catalina
What version of Vagrant are you running?
2.2.7
Are you using VirtualBox or VMWare and which version are you using?
Virtualbox 6.1
The text was updated successfully, but these errors were encountered: