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?
Windows with Docker Toolbox (Virtualbox) (which is the Elasticsearch documentation talking about)
So here you find the documentation for this https://docs.docker.com/toolbox/overview/#whats-in-the-box
using virtualization VirtualBox
including using command docker-machine ssh to connect to machine name "default"
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]
#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
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.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.