Elasticsearch crashes

I have installed Elasticsearch and am able to get it started with the command service elasticsearch start, but the service soon shuts down (within ~10sec).

I think the problem is related to memory as I see this error in the log

max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

However, I cannot seem to increase the value for vm.max_map_count. When I run sysctl -w vm.max_map_count=262144 I get the error setting key "vm.max_map_count": Read-only file system. I’ve also tried adding vm.max_map_count=262144 to /etc/sysctl.conf, but that makes no difference either.

Does someone know of a way to increase the value of vm.max_map_count or how to prevent Elasticsearch from crashing?

That’s an interesting one.

Can you try editing /etc/sysctl.conf with nano inside the container?

Yes, I’ve edited /etc/sysctl.conf with nano but Elasticsearch still says the virtual memory is too low. Here’s what I’ve got: nano-sysctl-conf

What error do you see after that change in /etc/sysctl.conf?

Thanks for following up, Clay. Here’s the error log:
elasticsearch.log (9.3 KB)

Can you please try this?

  1. Close Local
  2. Open up VirtualBox
  3. Right-click on local-by-flywheel and go to Close » ACPI Shutdown
  4. After the VM shuts down, open up the Settings for the local-by-flywheel VM
  5. Go to the “System” tab and increase the Base Memory from 1GB to 2GB
  6. Re-open Local and try Elasticsearch again

I adjusted the base memory to 2048 MB but it didn’t seem to help.
elasticsearch.log (10.3 KB)