1. 从官网下载对应的解析版本
https://github.com/medcl/elasticsearch-analysis-ik/releases/tag/v6.3.2
2. 配置环境
安装mvn环境
从官网下载对应的maven包
http://maven.apache.org/download.cgi
root@block:/usr/local/src# ls
apache-maven-3.6.1-bin.tar.gz elasticsearch-6.3.2.tar.gz ik logstash-6.3.2.tar.gz npm-debug.log
elasticsearch-6.3.0 elasticsearch-analysis-ik-6.3.2.tar.gz jdk1.8.0_151 maven scala-2.11.12
elasticsearch-6.3.0.tar.gz elasticsearch-analysis-ik-6.3.2.zip jdk-8u151-linux-x64.tar.gz node-v8.11.3 scala-2.11.8
elasticsearch-6.3.2 elasticsearch-head kibana-6.3.2-amd64.deb node-v8.11.3.tar.gz wget-log
修改名字
root@block:/usr/local/src# mv apache-maven-3.6.1 maven
配置mvn的环境变量
export MAVEN_HOME=/usr/local/src/maven
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH:${MAVEN_HOME}/bin
生效环境变量root@block:/usr/local/src# nano /etc/profile
root@block:/usr/local/src# source /etc/profile
验证配置
root@block:/usr/local/src# mvn -v
Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-05T03:00:29+08:00)
Maven home: /usr/local/src/maven
Java version: 1.8.0_151, vendor: Oracle Corporation, runtime: /usr/local/src/jdk1.8.0_151/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-116-generic", arch: "amd64", family: "unix"
root@block:/usr/local/src#
3. 解压并修改ik
root@block:/usr/local/src# tar -xzvf elasticsearch-analysis-ik-6.3.2.tar.gz
root@block:/usr/local/src# mv elasticsearch-analysis-ik-6.3.2 ik
4.切换到ik目录,并打包
root@block:/usr/local/src/ik# mvn clean package
稍等片刻,打包成功
或者 mvn clean mvn compile mvn package
5. 或者直接使用命令打包
root@block:/usr/local/src/elasticsearch-6.3.2# ./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.3.2/elasticsearch-analysis-ik-6.3.2.zip