ElasticSearch Install IK Analysis
下载原生镜像
本文以8.14.3为例.
docker pull docker.elastic.co/elasticsearch/elasticsearch:8.14.3
编写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 .
运行测试
单机启动,测试Dockerfile是否正确
启动的时候需要添加参数:ES_JAVA_OPTS=-Xms512m -Xmx512m,否则会报错
✅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
评论区