Skip to content

Commit

Permalink
Clarify commands shown for "permanently" setting max_map_count (elast…
Browse files Browse the repository at this point in the history
…ic#82345) (elastic#83228)

* Clarify commands shown for "permanently" setting max_map_count

The current text shows a grep, which of course does not set the value at all.  I've clarified why it's offered (to CHECK the value).

I've also moved the command for setting the value temporarily to above that discussion, to make it more clear to readers that that's what it does.

* Reorder commands, add headings, and fix typos

Co-authored-by: Adam Locke <[email protected]>

Co-authored-by: Charlie Arehart <[email protected]>
  • Loading branch information
Adam Locke and carehart authored Jan 27, 2022
1 parent eb704be commit 3985697
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions docs/reference/setup/install/docker.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,12 @@ The following requirements and recommendations apply when running {es} in Docker

The `vm.max_map_count` kernel setting must be set to at least `262144` for production use.

How you set `vm.max_map_count` depends on your platform:
How you set `vm.max_map_count` depends on your platform.

====== Linux

To view the current value for the `vm.max_map_count` setting, run:

* Linux
+
--
The `vm.max_map_count` setting should be set permanently in `/etc/sysctl.conf`:
[source,sh]
--------------------------------------------
grep vm.max_map_count /etc/sysctl.conf
Expand All @@ -374,11 +374,12 @@ To apply the setting on a live system, run:
--------------------------------------------
sysctl -w vm.max_map_count=262144
--------------------------------------------
--

* macOS with https://docs.docker.com/docker-for-mac[Docker for Mac]
+
--
To permanently change the value for the `vm.max_map_count` setting, update the
value in `/etc/sysctl.conf`.

====== macOS with https://docs.docker.com/docker-for-mac[Docker for Mac]

The `vm.max_map_count` setting must be set within the xhyve virtual machine:

. From the command line, run:
Expand All @@ -388,39 +389,35 @@ The `vm.max_map_count` setting must be set within the xhyve virtual machine:
screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
--------------------------------------------

. Press enter and use`sysctl` to configure `vm.max_map_count`:
. Press enter and use `sysctl` to configure `vm.max_map_count`:
+
[source,sh]
--------------------------------------------
sysctl -w vm.max_map_count=262144
--------------------------------------------

. To exit the `screen` session, type `Ctrl a d`.
--

* Windows and macOS with https://www.docker.com/products/docker-desktop[Docker Desktop]
+
--
====== Windows and macOS with https://www.docker.com/products/docker-desktop[Docker Desktop]

The `vm.max_map_count` setting must be set via docker-machine:

[source,sh]
--------------------------------------------
docker-machine ssh
sudo sysctl -w vm.max_map_count=262144
--------------------------------------------
--

* Windows with https://docs.docker.com/docker-for-windows/wsl[Docker Desktop WSL 2 backend]
+
--
====== Windows with https://docs.docker.com/docker-for-windows/wsl[Docker Desktop WSL 2 backend]

The `vm.max_map_count` setting must be set in the docker-desktop container:

[source,sh]
--------------------------------------------
wsl -d docker-desktop
sysctl -w vm.max_map_count=262144
--------------------------------------------
--


===== Configuration files must be readable by the `elasticsearch` user

Expand Down

0 comments on commit 3985697

Please sign in to comment.