温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

es5.4安装head、ik中文分词插件

发布时间:2020-06-27 18:39:38 来源:网络 阅读:9218 作者:shouhou2581314 栏目:建站服务器
  1. 安装maven打包工具

wget http://mirror.bit.edu.cn/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
tar -xf apache-maven-3.3.9-bin.tar.gz
mv apache-maven-3.3.9 /usr/local/data/apache-maven
vim /etc/profile
export MAVEN_HOME=/usr/local/data/apache-maven
export PATH=$PATH:$MAVEN_HOME/bin
source /etc/profile

  2. 安装ik分词

git  clone https://github.com/medcl/elasticsearch-analysis-ik
cd elasticsearch-analysis-ik/
mvn package
ll /usr/local/data/elasticsearch-analysis-ik/target/releases/
total 4400
-rw-r--r-- 1 root root 4502096 May 26 11:29 elasticsearch-analysis-ik-5.4.0.zip

创建分词目录

mkdir /usr/local/data/elasticsearch/plugins/ik
cp target/releases/elasticsearch-analysis-ik-5.4.0.zip  /usr/local/data/elasticsearch/plugins/ik/
cd /usr/local/data/elasticsearch/plugins/ik && unzip elasticsearch-analysis-ik-5.4.0.zip
chown -R es.es /usr/local/data/elasticsearch

测试分词

http://172.16.230.198:9200/index/_analyze?analyzer=ik_max_word&text=×××

es5.4安装head、ik中文分词插件

 3.安装head插件

yum -y install git npm
git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install
npm install -g cnpm --registry=
修改head监听地址为内网
vim Gruntfile.js
                connect: {
                        server: {
                                options: {
                                        hostname:'172.16.230.198',
                                        port: 9100,
                                        base: '.',
                                        keepalive: true
                                }
                        }
                }
后台启动elasticsearch-head 插件
npm install grunt-cli
ln -s /usr/local/data/elasticsearch-head/node_modules/grunt/bin/grunt  /usr/bin/
grunt  server &

遇到的问题:head 插件无法连接es集群 显示集群健康值未连接

修改head的es监听地址

cd elasticsearch-head
vim _site/app.js

修改 『http://localhost:9200』字段到本机ES端口与IP

vim $ES_HOME$/config/elasticsearch.yml
# 增加如下字段
http.cors.enabled: true
http.cors.allow-origin: "*"

重启es 和head即可


向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

es he
AI