Using wsl2 install elasticsearch cant' create vm.max_map_cout

i have using wsl2 and debian 9.9 from windows appstore , install elasticsearch 7.2 and service elasticsearch start sucess but have a error ,when i startup another node from command, always have a same error . system can't create vm.max_map_count. wsl2 how cant setup vm.max_map_count?
when i starup from command,

elasticsearch@zhangqi:/usr/share/elasticsearch/bin$ ./elasticsearch -E node.name=node01 -E cluster.name=zhangqi -E path.data=/home/elasticsearch/data/node01
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
[2019-07-06T17:35:44,741][INFO ][o.e.p.PluginsService ] [zhangqi] loaded module [x-pack-watcher]
[2019-07-06T17:35:44,742][INFO ][o.e.p.PluginsService ] [zhangqi] no plugins loaded
[2019-07-06T17:35:47,560][INFO ][o.e.x.s.a.s.FileRolesStore] [zhangqi] parsed [0] roles from file [/etc/elasticsearch/roles.yml]
[2019-07-06T17:35:48,054][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [zhangqi] [controller/27452] [Main.cc@110] controller (64 bit): Version 7.2.0 (Build 65aefcbfce449b) Copyright (c) 2019 Elasticsearch BV
[2019-07-06T17:35:48,371][DEBUG][o.e.a.ActionModule ] [zhangqi] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
[2019-07-06T17:35:48,790][INFO ][o.e.d.DiscoveryModule ] [zhangqi] using discovery type [zen] and seed hosts providers [settings]
[2019-07-06T17:35:49,389][INFO ][o.e.n.Node ] [zhangqi] initialized
[2019-07-06T17:35:49,389][INFO ][o.e.n.Node ] [zhangqi] starting ...
[2019-07-06T17:35:49,500][INFO ][o.e.t.TransportService ] [zhangqi] publish_address {10.11.3.186:9300}, bound_addresses {[::]:9300}
[2019-07-06T17:35:49,507][INFO ][o.e.b.BootstrapChecks ] [zhangqi] bound or publishing to a non-loopback address, enforcing bootstrap checks
[2019-07-06T17:35:49,509][WARN ][o.e.b.BootstrapChecks ] [zhangqi] I/O exception while trying to read [/proc/sys/vm/max_map_count]
java.nio.file.NoSuchFileException: /proc/sys/vm/max_map_count
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:92) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116) ~[?:?]
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:219) ~[?:?]
at java.nio.file.Files.newByteChannel(Files.java:373) ~[?:?]
at java.nio.file.Files.newByteChannel(Files.java:424) ~[?:?]
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:420) ~[?:?]
at java.nio.file.Files.newInputStream(Files.java:158) ~[?:?]
......
root@zhangqi:/usr/share/elasticsearch/bin# cat /proc/sys/vm/max_map_count
"can't create vm.max_map_count"
root@zhangqi:/usr/share/elasticsearch/bin# echo 262144> /proc/sys/vm/max_map_count
bash: /proc/sys/vm/max_map_count: Operation not permitted

Please don't post pictures of text, they are difficult to read, impossible to search and some people may not be even able to see them :slight_smile:

i have remove picture:sweat_smile:

Hello @rick_zhang

The "vm.max_map_count" it's a linux kernel parameter. You are using WSL2 which have a linux but I think that only if you uses a distro backed by "WSL2" did you follow the official Install guide? https://docs.microsoft.com/en-us/windows/wsl/wsl2-install

To be honest it's more an WSL issue than an elasticsearch one, WSL never have been friendly with kernel parameters. And as I see a file not found exception seems that you have taken a linux image without kernel.

I hope this helps

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.