Docker安装ES7
1、创建3个文件夹
[root@localhost ~]# cd /home/ [root@localhost home]# mkdir es7/config -p [root@localhost home]# mkdir es7/data -p [root@localhost home]# mkdir es7/plugins -p [root@localhost home]# cd es7/ [root@localhost es7]# chmod -R 777 /home/es7/
2、添加配置文件
cd config vim elasticsearch.yml 添加:http.host: 0.0.0.0
3、拉取镜像
docker pull elasticsearch:7.16.1
4、启动es
docker run --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e ES_JAVA_OPS="-Xms64m -Xmx256m" -v /home/es7/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml -v /home/es7/data:/usr/share/elasticsearch/data -v /home/es7/plugins:/usr/share/elasticsearch/plugins --restart=always -d elasticsearch:7.16.1
5、浏览器查看是否启动成功
安装ik中文分词器
1、下载
https://github.com/medcl/elasticsearch-analysis-ik/releases/tag/v7.16.1
2、上传到/home/es7/plugins/ik文件夹中
3、解压
unzip elasticsearch-analysis-ik-7.16.1.zip
4、重启es
docker restart elasticsearch
5、测试中文分词器
http://192.168.233.128:9200/_analyze