前言
该文档是整合线上安装资料,在centos7.6系统上安装,安装前先保证本地有docker环境。
检索镜像
docker search elasticsearch
下载镜像
docker pull nshou/elasticsearch-kibana
安装镜像
docker run -it --name es-kibana -d -p 9200:9200 -p 5601:5601 nshou/elasticsearch-kibana
访问kibana是否正常
http://127.0.0.1:5601
注:9200和5601端口需开放
安装IK中文分词
- 进入docker容器
docker exec -it es-kibana /bin/bash
-
IK分词插件地址
https://github.com/medcl/elasticsearch-analysis-ik
安装IK分词插件
- 命令行安装方式
elasticsearch@1db5bbf8809a:~$ cd /home/elasticsearch/elasticsearch-7.9.0/bin/
elasticsearch@1db5bbf8809a:~/elasticsearch-7.9.0/bin$ ./elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.9.0/elasticsearch-analysis-ik-7.9.0.zip
- 解压缩安装方式
elasticsearch@1db5bbf8809a:~$ wget https://github.com/medcl/elasticsearch-analysis-ik/archive/v7.9.0.tar.gz
elasticsearch@1db5bbf8809a:~$ tar zxvf v7.9.0.tar.gz
elasticsearch@1db5bbf8809a:~$ mv elasticsearch-analysis-ik-7.9.0/ /home/elasticsearch/elasticsearch-7.9.0/plugins/ik
elasticsearch@1db5bbf8809a:~$ cd /home/elasticsearch/elasticsearch-7.9.0/plugins/ik
elasticsearch@1db5bbf8809a:~$ mvn clean
elasticsearch@1db5bbf8809a:~$ mvn compile
elasticsearch@1db5bbf8809a:~$ mvn package
注:此镜像默认用户是elasticsearch需使用sudo来安装maven才能使用mvn
- 退出docker重启下es-kibana容器
elasticsearch@1db5bbf8809a:~$ exit
[root@dev ~]# docker restart es-kibana
- 测试是否安装成功