热爱技术,追求卓越
不断求索,精益求精

docker环境下elasticsearch安装 ik ,pinyin分词插件

前提条件:安装了docker—》启动docker服务—》使用docker安装了elasticsearch—》启动了elasticsearch的docker容器。

1、找到容器的id,进入elasticsearch容器

docker ps

容器ID为:b9b6c5ab5673;elasticsearch版本为7.7。

进入容器:

docker exec -it b9b6c5ab5673 /bin/bash

3、安装 elasticsearch 的 ik 分词插件。

插件的版本要和 elasticsearch 的版本一致

ik 分词地址: https://github.com/medcl/elasticsearch-analysis-ik/

./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.7.0/elasticsearch-analysis-ik-7.7.0.zip

安装结果如下:

# ./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.7.0/elasticsearch-analysis-ik-7.7.0.zip
-> Installing https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.7.0/elasticsearch-analysis-ik-7.7.0.zip
-> Downloading https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.7.0/elasticsearch-analysis-ik-7.7.0.zip
[=================================================] 100%?? 
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@     WARNING: plugin requires additional permissions     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
* java.net.SocketPermission * connect,resolve
See http://docs.oracle.com/javase/8/docs/technotes/guides/security/permissions.html
for descriptions of what these permissions allow and the associated risks.

Continue with installation? [y/N]y
-> Installed analysis-ik

4、安装 pinyin 分词插件,插件的版本要和 elasticsearch 的版本一致

pinyin分词地址: https://github.com/medcl/elasticsearch-analysis-pinyin/

./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-pinyin/releases/download/v7.7.0/elasticsearch-analysis-pinyin-7.7.0.zip

安装结果如下:

# ./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-pinyin/releases/download/v7.7.0/elasticsearch-analysis-pinyin-7.7.0.zip
-> Installing https://github.com/medcl/elasticsearch-analysis-pinyin/releases/download/v7.7.0/elasticsearch-analysis-pinyin-7.7.0.zip
-> Downloading https://github.com/medcl/elasticsearch-analysis-pinyin/releases/download/v7.7.0/elasticsearch-analysis-pinyin-7.7.0.zip
[=================================================] 100%?? 
-> Installed analysis-pinyin

5、退出容器

exit

6、重启容器

# docker restart b9b6c5ab5673

7、进入容器,查看容器加载的插件

docker exec -it b9b6c5ab5673 /bin/bash

elasticsearch-plugin list

结果如下:

# elasticsearch-plugin list
analysis-ik
analysis-pinyin
赞(1)
未经允许不得转载:LoveCTO » docker环境下elasticsearch安装 ik ,pinyin分词插件

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

热爱技术 追求卓越 精益求精