赞
踩
1、创建目录
- mkdir -p /data/elasticsearch8092/data
- mkdir -p /data/elasticsearch8092/logs
- cd /data/elasticsearch8092
2、增加配置
vim elasticsearch.yml
"""
- cluster.name: "es-cluster"
- network.host: 0.0.0.0
-
- http.cors.enabled: true
- http.cors.allow-origin: "*"
"""
3、设置权限
chmod 777 -R /data/elasticsearch8092
4、拉取镜像
docker pull elasticsearch:7.10.1
5、启动服务
- docker run -m 10g --restart always --name="es8092" \
- -p 8092:9200 -p 8093:9300 \
- -e ES_JAVA_OPTS="-Xms1g -Xmx2g" -e "discovery.type=single-node" \
- -v /data/elasticsearch8092/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
- -v /data/elasticsearch8092/data:/usr/share/elasticsearch/data \
- -v /data/elasticsearch8092/logs/:/usr/share/elasticsearch/logs \
- -d elasticsearch:7.10.1
安装ik分次器
首先进入Elasticsearch容器
#进入容器
docker exec -it es8092 /bin/bash
#进入 plugins目录
cd plugins/
#创建ik文件夹
mkdir ik
#进入ik目录
cd ik
#拉取elasticsearch-analysis-ik-7.10.1
wget https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.10.1/elasticsearch-analysis-ik-7.10.1.zip
解压压缩包
unzip elasticsearch-analysis-ik-7.10.1.zip
#移除elasticsearch-analysis-ik-7.10.1.zip
rm -f elasticsearch-analysis-ik-7.10.1.zip
然后exit退出容器,重启容器就安装好了
- docker pull mobz/elasticsearch-head:5
-
- docker create --name elasticsearch-head -p 9100:9100 mobz/elasticsearch-head:5
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。