受欢迎的博客标签

How to Install Elasticsearch 9.x with Docker

Published

https://www.elastic.co/docs/deploy-manage/deploy/self-managed/install-elasticsearch-with-docker#docker-compose-file

 

https://www.elastic.co/blog/getting-started-with-the-elastic-stack-and-docker-compose

 

docker pull docker.elastic.co/elasticsearch/elasticsearch:9.1.4

 

cd /datadocker/elasticsearch

~~~
 docker run -d \
  --name elasticsearch \
  --network host \
  -e "discovery.type=single-node" \
  -e "xpack.security.enabled=false" \
  -e "ES_JAVA_OPTS=-Xms2g -Xmx2g" \
  -v ~/elasticsearch/data:/usr/share/elasticsearch/data \
  docker.elastic.co/elasticsearch/elasticsearch:9.1.4
~~~

 

# Fix permissions - mounting the working directory

sudo chown -R 1000:0 /datadocker/elasticsearch

sudo chmod -R 775 /datadocker/elasticsearch

 

curl http://127.0.0.1:9200

 

docker stop elasticsearch
docker rm elasticsearch