ElasticSearch Config - Issues SSHing into default linux machine

I've recently installed Docker on Windows 10 Enterprise in order to run an Elasticsearch environment. Going through the documentation here, I'm instructed to run docker-machine ssh and sudo sysctl -w vm.max_map_count=262144, however, when I do so, I receive:

Error: No machine name(s) specified and no "default" machine exists

A quick look at docker-machine ls does now show any machines, but I do see the MobyLinuxVM running in HyperV. Is this the machine I should be connecting to, or am I needing to create another machine outside of MobyLinuxVM?


Welcome to the Elastic Community and thank you for your post.

I think you are referring to this direct link
So just a short clarification let me describe most short as I can:
Under Windows there are at most 2 variants to install docker:

  1. Windows with Docker Toolbox (Virtualbox) (which is the Elasticsearch documentation talking about)
    So here you find the documentation for this
    using virtualization VirtualBox
    including using command docker-machine ssh to connect to machine name "default"

  2. Windows Docker Desktop with Docker Community Editon (Hyper-V) (what you are talking about)
    There is the machine name like you stated already "MobyLinuxVM" and uses Hypervisor Hyper-V.

So in case you get during starting up the docker container the following Elasticsearch error:

Exception in thread "main" java.lang.RuntimeException: bootstrap checks failed
max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]

You can solve that with this discussion entry from Docker because you cannot directly ssh to the MobyLinuxVM:
So let me just state this snippet:

#get a privileged container with access to Docker daemon
docker run --privileged -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker alpine sh

#run a container with full root access to MobyLinuxVM and no seccomp profile (so you can mount stuff)
docker run --net=host --ipc=host --uts=host --pid=host -it --security-opt=seccomp=unconfined --privileged --rm -v /:/host alpine /bin/sh

#switch to host FS
chroot /host

# And now set the value
sudo sysctl -w vm.max_map_count=262144

Hope that helps, would be good to get some feedback if this worked out for you.

Because that would give me the possibility to add this information to the docs.

Ok. Running through what you provided and using the two node cluster example in the document, I get the following error 78. Some searching leads back to the initial kernel setting, but I also noticed this

e[33melasticsearch1 |e[0m [1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured

e[33melasticsearch1 exited with code 78

Just to follow up, your suggestion did solve my issue. My second error was due to an incorrect .yml file. Not sure if the example in the documents changed or I copied it wrong, but I pulled it down again and everything worked.

Only modification I'd make is that once I got into the VM, I got an error trying to run sysctl with sudo. The fix was to run the exact same command, no sudo.

1 Like

Good, that is great news. Thank you for the input.

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