侧边栏壁纸
博主头像
★街角晚灯★博主等级

博观而约取 厚积而薄发

  • 累计撰写 461 篇文章
  • 累计创建 184 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

ElasticSearch Install IK Analysis|ES安装IK分词器

WinJay
2024-10-08 / 0 评论 / 0 点赞 / 7 阅读 / 3371 字 / 正在检测是否收录...
温馨提示:
文章发布较早,内容可能过时,阅读注意甄别。。。。

ElasticSearch Install IK Analysis

image-20241008163216511

下载原生镜像

本文以8.14.3为例.

docker pull docker.elastic.co/elasticsearch/elasticsearch:8.14.3

image-20240801101553607

编写Dockerfile

FROM docker.elastic.co/elasticsearch/elasticsearch:8.14.3
MAINTAINER WinJayX
LABEL description="IK Analysis for Elasticsearch and OpenSearch"
LABEL version="8.14.3"
# USER root    # can not run elasticsearch as root

# ! Breaking Change:
# The latest version of the plugin packages are no longer release or upload to Github.
# RUN sh -c '/bin/echo -e "y" | /usr/share/elasticsearch/bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.4.0/elasticsearch-analysis-ik-7.4.0.zip'

RUN sh -c '/bin/echo -e "y" | /usr/share/elasticsearch/bin/elasticsearch-plugin install https://release.infinilabs.com/analysis-ik/stable/elasticsearch-analysis-ik-8.14.3.zip'

构建自定义镜像

docker build -t hub.litsoft.com.cn/tools/elasticsearch_ik:8.14.3 .

image-20240801101824095

运行测试

  • 单机启动,测试Dockerfile是否正确

  • 启动的时候需要添加参数:ES_JAVA_OPTS=-Xms512m -Xmx512m,否则会报错

image-20240801103158759

✅Elasticsearch security features have been automatically configured!
✅ Authentication is enabled and cluster connections are encrypted.

ℹ️  Password for the elastic user (reset with `bin/elasticsearch-reset-password -u elastic`):
  4waohvFui62WP+k76nXz

ℹ️  HTTP CA certificate SHA-256 fingerprint:
  11c0d69735d97178a6e3f45dd44c0a1d62e69e73885136dd90e6165cfc00ee73

ℹ️  Configure Kibana to use this cluster:
• Run Kibana and click the configuration link in the terminal when Kibana starts.
• Copy the following enrollment token and paste it into Kibana in your browser (valid for the next 30 minutes):
  eyJ2ZXIiOiI4LjE0LjAiLCJhZHIiOlsiMTcyLjE3LjAuMzo5MjAwIl0sImZnciI6IjExYzBkNjk3MzVkOTcxNzhhNmUzZjQ1ZGQ0NGMwYTFkNjJlNjllNzM4ODUxMzZkZDkwZTYxNjVjZmMwMGVlNzMiLCJrZXkiOiJGUERDQzVFQmhobVZaRzRkY216TDpJWV84ZXlPeFRheVR6UTdiUXpEbDV3In0=

ℹ️ Configure other nodes to join this cluster:
• Copy the following enrollment token and start new Elasticsearch nodes with `bin/elasticsearch --enrollment-token <token>` (valid for the next 30 minutes):
  eyJ2ZXIiOiI4LjE0LjAiLCJhZHIiOlsiMTcyLjE3LjAuMzo5MjAwIl0sImZnciI6IjExYzBkNjk3MzVkOTcxNzhhNmUzZjQ1ZGQ0NGMwYTFkNjJlNjllNzM4ODUxMzZkZDkwZTYxNjVjZmMwMGVlNzMiLCJrZXkiOiJGdkRDQzVFQmhobVZaRzRkY216TDpqV2IzVk54dlF2dUxVZ1NPRF9WYjJnIn0=

上传到私有仓库

docker push hub.litsoft.com.cn/tools/elasticsearch_ik:8.14.3

image-20240801110238024

0
  1. 支付宝打赏

    qrcode alipay
  2. 微信打赏

    qrcode weixin

评论区