-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Test sysctl vm.max_map_count before failing init script #27236
Comments
I would accept a PR for this.
This is fine, we require Please ensure that the packaging tests pass too, perhaps expanding a test case if needed to cover the case when |
Apologies for delay, vacation, work, etc. |
No, look at the packaging tests in qa/vagrant; you can create test that sets |
@biggreenogre Are you still interested in contributing a PR for this? |
Yes,
changed jobs just after last communication and it got lost in the shuffle.
Let me figure out where I was and I'll create one soon
regards,
Drew
…On 12/03/18, Ryan Ernst ***@***.***> wrote:
@biggreenogre(https://github.com/biggreenogre) Are you still interested in contributing a PR for this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub(#27236 (comment)), or mute the thread(https://github.com/notifications/unsubscribe-auth/ADzaY1bFqu7EAOM1VCamc_l-4rRSj5g1ks5tdvXugaJpZM4QP6tp).
|
Currently init scripts fail when `/proc/sys/vm/max_map_count` is not present with `-bash: [: too many arguments`. Fix conditional logic to avoid trying to set the `max_map_count` sysctl if not present. Relates #27236
…5933) Currently init scripts fail when `/proc/sys/vm/max_map_count` is not present with `-bash: [: too many arguments`. Fix conditional logic to avoid trying to set the `max_map_count` sysctl if not present. Relates elastic#27236
…5933) Currently init scripts fail when `/proc/sys/vm/max_map_count` is not present with `-bash: [: too many arguments`. Fix conditional logic to avoid trying to set the `max_map_count` sysctl if not present. Relates elastic#27236
Elasticsearch version (
bin/elasticsearch --version
): <= current masterPlugins installed: n/a
JVM version (
java -version
): anyOS version (
uname -a
if on a Unix-like system): Linux xxxx 4.10.0-37-generic #41~16.04.1-Ubuntu SMP Fri Oct 6 22:42:59 UTC 2017 x86_64 x86_64 x86_64 GNU/LinuxDescription of the problem including expected versus actual behavior:
elasticsearch daemon always fails to start when run inside a container.
Assuming value of vm.max_map_count >= MAX_MAP_COUNT, I expect the daemon to start when the init script is run.
The elasticsearch daemon requires that the value of /proc/sys/vm/max_map_count be equal to or greater than MAX_MAP_COUNT. The daemon init script attempts to set this value with sysctl.
Unfortunately, since this value cannot be set from inside a container, the init script always fails, even when the current value is perfectly good.
Issue was encountered in LXC containers, it also applies to LXD, Docker and other container environments.
Given that the smarter DevOps practitioner will set this value on the host PRIOR to starting the container, would it be reasonable to TEST the value before refusing to start the daemon?
I proposes a minor change to distribution/deb/src/main/packaging/init.d/elasticsearch (and other OS scripts as applicable) as follows:
As a sysadmin, it "feels wrong" to change a kernel parameter, potentially affecting other applications on the host, without first checking if the change is required. This patch adds a test of the current value of vm.max_map_count against MAX_MAP_COUNT. If the current value equals or exceeds the required value, no action is taken and the daemon will start. Only if the current value is insufficient, will the script attempt to make the change and fail.
My only concern is for the portability of the test construct, in case it is too "BASH-centric".
I will submit a pull request including patches for all the supported OS init scripts if this would be acceptable.
More background info at voxpupuli/puppet-elasticsearch#887
regards,
Drew
Steps to reproduce:
The text was updated successfully, but these errors were encountered: