docker安装elasticsearch8.14.3
- 安装镜像
sudo docker pull docker.elastic.co/elasticsearch/elasticsearch:8.14.3
- 创建容器
在宿主机创建以下目录
docker run -d \
--restart=always \
--name dev-es \
--network es_work \
-p 9202:9200 \
-p 9302:9300 \
--privileged \
-v /data/develop/hjy/es8.14.3/data:/usr/share/elasticsearch/data \
-v /data/develop/hjy/es8.14.3/plugins:/usr/share/elasticsearch/plugins \
-v /data/develop/hjy/es8.14.3/config:/usr/share/elasticsearch/config \
-v /data/develop/hjy/es8.14.3/logs:/usr/share/elasticsearch/logs \
-e "discovery.type=single-node" \
-e "ES_JAVA_OPTS=-Xms512m -Xmx512m" \
docker.elastic.co/elasticsearch/elasticsearch:8.14.3
- 查看日志
sudo docker logs dev-es
出现
停用dev-es
sudo docker stop dev-es
创建模板es
docker run --name=elasticsearch8.14.3 -p 9202:9202 -p 9302:9302 -e "discovery.type=single-node" -d docker.elastic.co/elasticsearch/elasticsearch:8.14.3
docker run -d --name elasticsearch \
-p 9200:9200 -p 9300:9300 \
-e "discovery.type=single-node" \
docker.elastic.co/elasticsearch/elasticsearch:8.14.3
将模板es中的配置文件复制到宿主机挂载目录下
sudo docker cp elasticsearch8.14.3:/usr/share/elasticsearch /data/develop/hjy/es8.14.3
安装参考教程
https://blog.csdn.net/weixin_71696121/article/details/133710660