1配置环境node
下载node地址:https://nodejs.org/en/download/
其他系统的安装教程在:https://nodejs.org/en/download/package-manager/
主流的几个系统(Debian and Ubuntu based Linux distributions, Enterprise Linux/Fedora(centos) and Snap packages):https://github.com/nodesource/distributions/blob/master/README.md
NodeJS 11.x
curl -sL https://rpm.nodesource.com/setup_11.x | bash -
NodeJS 10.x
curl -sL https://rpm.nodesource.com/setup_10.x | bash -
NodeJS 8.x
curl -sL https://rpm.nodesource.com/setup_8.x | bash -
NodeJS 6.x
curl -sL https://rpm.nodesource.com/setup_6.x | bash -
编译上面的文件需要用到的工具 (推荐:yum groupinstall 'Development Tools')
yum install gcc-c++ make
# or: yum groupinstall 'Development Tools'
查看对应的版本
node -v
npm -v
2.下载head 文件
yum install –y git
git clone https://github.com/mobz/elasticsearch-head.git
3.安装 grunt
cd elasticsearch-head
npm install -g grunt --registry=https://registry.npm.taobao.org
4.安装插件
npm install
如果node_modules/grunt 没有二进制文件这执行
npm install grunt --save
5修改配置文件Gruntfile.js
在hostname添加elasticsearch-head地址
a.vim Gruntfile.js
hostname: '0.0.0.0',
b.vim ./_site/app.js
将localhost修改为ESdeIP地址
修改前:this.base_uri = this.config.base_uri;
修改后: this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://you ip address:9200";
6.运行插件
npm run start ( or ./node_modules/grunt/bin/grunt server)