DEV Community

shun
shun

Posted on

2

Configuring vm.max_map_count for Elasticsearch in Docker using WSL

Configuring vm.max_map_count for Elasticsearch in Docker using WSL

When running Elasticsearch on Docker, you might encounter an error message like the following if the default value of vm.max_map_count is too low:

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

To resolve this error, you need to use Windows Subsystem for Linux (WSL) to properly configure the value of vm.max_map_count.

Accessing Docker Desktop's WSL Environment
Open a command prompt and access the WSL environment of Docker Desktop using the following command:

PS C:\work\project\logstash> wsl -d docker-desktop
Enter fullscreen mode Exit fullscreen mode

Modifying System Settings
Once inside the WSL environment, use the following command to change the value of vm.max_map_count:

DESKTOP-XXXXXXX:/path/to/directory# sysctl -w vm.max_map_count=262144
Enter fullscreen mode Exit fullscreen mode

Exiting the WSL Environment
Exit the WSL environment using the following command:

DESKTOP-XXXXXXX:/path/to/directory# exit
Enter fullscreen mode Exit fullscreen mode

Following these steps should resolve the Elasticsearch error related to vm.max_map_count, allowing Elasticsearch to run smoothly.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more