How to Install Elasticsearch using Docker - Step by Step Guide

Technical Voice
Technical Voice
9.4 هزار بار بازدید - 11 ماه پیش - In this tutorial, I'll show
In this tutorial, I'll show you how to install Elasticsearch using Docker. Elasticsearch is a powerful search and analytics engine that's essential for many modern applications. Docker allows us to set up Elasticsearch quickly and easily in a containerized environment.

Reference Link: https://www.elastic.co/guide/en/elast...

Here are the steps to install Elasticsearch using Docker:

Pull the Elasticsearch Docker Image: We'll start by pulling the Elasticsearch image from the official Elastic repository. Open your terminal or command prompt and enter the following command:

bash
Copy code
docker pull docker.elastic.co/elasticsearch/elasticsearch:8.9.0
Create a Docker Network: Elasticsearch needs a network for communication. Let's create a Docker network named "elastic":

lua
Copy code
docker network create elastic
Run the Elasticsearch Container: Now, let's run the Elasticsearch container using the image we pulled earlier. We'll name the container "es01," connect it to the "elastic" network, and map port 9200 (Elasticsearch HTTP) to the host:

css
Copy code
docker run --name es01 --net elastic -p 9200:9200 -it docker.elastic.co/elasticsearch/elasticsearch:8.9.0
Handling Memory Exceptions (if needed): If you encounter memory exceptions while running the container, use the following command to increase the vm.max_map_count value:

arduino
Copy code
wsl -d docker-desktop sh -c "sysctl -w vm.max_map_count=262144"
That's it! You now have Elasticsearch up and running using Docker. You can access Elasticsearch by opening your web browser and navigating to http://localhost:9200.

If you found this tutorial helpful, please give it a thumbs up and consider subscribing for more useful tutorials on Elasticsearch, Docker, and other technology topics. If you have any questions or need further assistance, please leave a comment below. Thanks for watching!
11 ماه پیش در تاریخ 1402/05/21 منتشر شده است.
9,497 بـار بازدید شده
... بیشتر