Permalink
Browse files

Add option to skip kernel parameters on install

During package install on systemd-based systems, we try to set
vm.max_map_count. On some systems (e.g., containers), users do not have
the ability to tune these parameters from within the container. This
commit provides an option for these users to skip setting such kernel
parameters.

Relates #21899
  • Loading branch information...
1 parent 6522538 commit 32df032c5944326e351a7910a877d1992563f791 @jasontedor jasontedor committed Dec 1, 2016
@@ -52,10 +52,17 @@ case "$1" in
esac
# to pick up /usr/lib/sysctl.d/elasticsearch.conf
-if command -v /usr/lib/systemd/systemd-sysctl > /dev/null; then
- /usr/lib/systemd/systemd-sysctl
-elif command -v /lib/systemd/systemd-sysctl > /dev/null; then
- /lib/systemd/systemd-sysctl
+if [ "${ES_SKIP_SET_KERNEL_PARAMETERS:-false}" == "false" ]; then
+ if command -v /usr/lib/systemd/systemd-sysctl > /dev/null; then
+ /usr/lib/systemd/systemd-sysctl
+ elif command -v /lib/systemd/systemd-sysctl > /dev/null; then
+ /lib/systemd/systemd-sysctl
+ fi
+elif [ "$ES_SKIP_SET_KERNEL_PARAMETERS" == "true" ]; then
+ echo "skipping setting kernel parameters"
+else
+ echo "unrecognized value [$ES_SKIP_SET_KERNEL_PARAMETERS] for ES_SKIP_SET_KERNEL_PARAMETERS; must [false] (default) or [true]"
+ exit 1
fi
if [ "x$IS_UPGRADE" != "xtrue" ]; then
@@ -96,6 +96,7 @@ Examine +/etc/apt/sources.list.d/elasticsearch-{major-version}.list+ for the dup
endif::[]
+include::skip-set-kernel-parameters.asciidoc[]
[[install-deb]]
==== Download and install the Debian package manually
@@ -112,6 +112,8 @@ sudo rpm --install elasticsearch-{version}.rpm
endif::[]
+include::skip-set-kernel-parameters.asciidoc[]
+
include::init-systemd.asciidoc[]
[[rpm-running-init]]
@@ -0,0 +1,2 @@
+NOTE: On systemd-based distributions, the installation scripts will attempt to set kernel parameters (e.g.,
+`vm.max_map_count`); you can skip this by setting the environment variable `ES_SKIP_SET_KERNEL_PARAMETERS` to `true`.

0 comments on commit 32df032

Please sign in to comment.