docker的es镜像如何安装插件
- 使用
docker ps
命令获取docker镜像列表
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b76631ac7536 docker.elastic.co/elasticsearch/elasticsearch:7.2.0 "/usr/local/bin/dock…" 9 hours ago Up 28 minutes 9200/tcp, 9300/tcp es72_02
5a12d75fa5fd docker.elastic.co/elasticsearch/elasticsearch:7.2.0 "/usr/local/bin/dock…" 9 hours ago Up 28 minutes 0.0.0.0:9200->9200/tcp, 9300/tcp es72_01
d84471d958c9 docker.elastic.co/kibana/kibana:7.2.0 "/usr/local/bin/kiba…" 10 hours ago Up 28 minutes 0.0.0.0:5601->5601/tcp kibana72
b80a527307dd lmenezes/cerebro:0.8.3 "/opt/cerebro/bin/ce…" 10 hours ago Up 28 minutes 0.0.0.0:9000->9000/tcp cerebro
-
使用
sudo docker exec -it -u root [镜像名] /bin/bash
以root用户进入镜像,此时已默认在es目录下/usr/share/elasticsearch
-
使用
bin/elasticsearch-plugin intsall analysis-icu
安装插件, 显示如下则安装成功 (提供了Unicode的支持, 更好的支持亚洲语言)
注: 如出现
Exception in thread “main” java.net.UnknownHostException: artifacts.elastic.co
则表示无 root 权限, 需以root用户进入镜像
-> Downloading analysis-icu from elastic
[=================================================] 100%
-> Installed analysis-icu
-
使用
bin/elasticsearch-plugin list
查看安装的插件列表 -
退出容器
ctrl+p+q
在线安装
//插件名安装
bin/elasticsearch-plugin install analysis-icu
//url安装
bin/elasticsearch-plugin install [url]
离线安装
bin/elasticsearch-plugin install file:////home/Downloads/elasticsearch-analysis-ik-7.2.0.zip
网友评论