docker 部署 elasticsearch 并加载ik 分词器

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

启动es

docker run -e ES_JAVA_OPTS="-Xms256m -Xmx256m" -d -p 9200:9200 -p 9300:9300 --name es -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:6.7.1

相差8小时修正
docker run -e ES_JAVA_OPTS="-Xms1256m -Xmx1256m" -d -p 9200:9200 -p 9300:9300 -v /etc/localtime:/etc/localtime -v /etc/timezone:/etc/timezone  --name es -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:6.7.1

下载分词器
https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.7.1/elasticsearch-analysis-ik-6.7.1.zip

将宿主机上的分词器 复制到容器中

docker  cp /root/elasticsearch-analysis-ik-6.7.1/  es:/usr/share/elasticsearch/plugins

重启es

完成

你可能感兴趣的:(docker)