Elasticsearch head插件安装

1.下载插件:

2.下载nodejs:

3.安装nodejs:

(1)解压
(2)配置环境变量
1
2
3
export NODE_HOME=/usr/local/node-v6.9.2-linux-x64

export PATH=$PATH:$NODE_HOME/bin
(3)查看node和npm版本:
1
2
3
node -v

npm -v

4.解压head插件到/opt/module目录下:

1
unzip elasticsearch-head-master.zip

5.查看当前head插件目录下有无node_modules/grunt目录:

  • 如果没有,执行命令创建:
1
npm install grunt --save --registry=https://registry.npm.taobao.org

6.安装head插件:

1
npm install -g cnpm --registry=https://registry.npm.taobao.org

7.安装grunt

1
npm install -g grunt-cli --registry=https://registry.npm.taobao.org

8.编辑Gruntfile.js

1
vim Gruntfile.js

文件93行添加:

1
hostname:'0.0.0.0'

9.检查head根目录下是否存在base文件夹

  • 没有:将 _site下的base文件夹及其内容复制到head根目录下
1
2
3
mkdir base

cp base/* ../base/

10.启动grunt server:

1
grunt server -d

11.如果提示grunt的模块没有安装:

1
2
3
4
5
6
7
8
9
10
11
Local Npm module “grunt-contrib-clean” not found. Is it installed? 

Local Npm module “grunt-contrib-concat” not found. Is it installed?

Local Npm module “grunt-contrib-watch” not found. Is it installed?

Local Npm module “grunt-contrib-connect” not found. Is it installed?

Local Npm module “grunt-contrib-copy” not found. Is it installed?

Local Npm module “grunt-contrib-jasmine” not found. Is it installed?

执行命令:

1
2
3
4
5
6
7
8
9
10
11
npm install grunt-contrib-clean -registry=https://registry.npm.taobao.org

npm install grunt-contrib-concat -registry=https://registry.npm.taobao.org

npm install grunt-contrib-watch -registry=https://registry.npm.taobao.org

npm install grunt-contrib-connect -registry=https://registry.npm.taobao.org

npm install grunt-contrib-copy -registry=https://registry.npm.taobao.org

npm install grunt-contrib-jasmine -registry=https://registry.npm.taobao.org
  • 最后一个模块可能安装不成功,但是不影响使用。

12.浏览器访问head插件:http://192.168.109.133:9100

打赏
  • 版权声明: 本博客所有文章除特别声明外,著作权归作者所有。转载请注明出处!
  • Copyrights © 2015-2021 Movle
  • 访问人数: | 浏览次数:

请我喝杯咖啡吧~

支付宝
微信