美文网首页
三、安装Head插件

三、安装Head插件

作者: 茶铺里的水 | 来源:发表于2017-11-17 10:41 被阅读50次

(1)2.X版本安装head插件

2.X版本执行如下命令,安装完成后重启服务,然后打开http://localhost:9200/_plugin/head/

./plugin install mobz/elasticsearch-head

(2) 5.0以上版本安装head插件

5.0 以上版本中不支持直接安装head插件,需要启动一个服务。
由于head插件本质上还是一个nodejs的工程,因此需要安装node,使用npm来安装依赖的包。

安装node

node下载地址 nodejs.org/
node -v
v6.11.3
npm下载地址https://www.npmjs.com
npm -v
3.10.10

安装grunt

使用npm安装grunt:
npm install –g grunt–cli

grunt的安装过程如果碰到什么问题可参见如下两篇文章
grunt安装指南
grunt不是内部或外部命令

安装head插件

下载head
elasticsearch-head

到elasticsearch-head-master目录下,运行命令:
npm install

修改head插件配置
找到Gruntfile.js下的connect属性,增加 hostname: '0.0.0.0'
修改完成connect内容如下
connect: { server: { options: { hostname: '0.0.0.0', port: 9100, base: '.', keepalive: true } } }

修改ES配置

编辑elasticsearch-5.5.0/config/elasticsearch.yml,加入以下内容:
http.cors.enabled: true
http.cors.allow-origin: "*"

启动ES

见文章一

启动Head插件

到elasticsearch-head-master目录下,执行
grunt server

image.png

打开浏览器http://localhost:9100/,见到如下图,即安装成功

image.png

相关文章

网友评论

      本文标题:三、安装Head插件

      本文链接:https://www.haomeiwen.com/subject/wbxrvxtx.html