elasticsearch-5x 安装head插件

2016-12-27  本文已影响0人  black3y
  1. 下载head插件
$ apt-get install git
$ git clone git://github.com/mobz/elasticsearch-head.git
$ mv elasticsearch-head /usr/share/head
$ chmod -R 777 /usr/share/head
  1. 下载安装node
    下载源:https://nodejs.org/en/download/
    此处下载https://nodejs.org/dist/v6.9.2/node-v6.9.2-linux-x64.tar.xz
    解压:
$ xz -d node-v6.9.2-linux-x64.tar.xz
$ tar -xvf node-v6.9.2-linux-x64.tar
$ mv node-v6.9.2-linux-x64 /usr/share/node-v6.9.2-linux-x64
  1. 配置环境变量
$ vim /etc/profile 添加下面一行
export export PATH=/usr/share/node-v6.9.2-linux-x64/bin:$PATH

使配置文件生效

$ source /etc/profile

查看是否配置成功:

$ node -v
$ npm -v
  1. 指定npm源为淘宝的
$ npm config set registry https://registry.npm.taobao.org
  1. 安装grunt
$ npm install grunt --save-dev
$ npm install -g grunt-cli

查看是否安装成功以及版本:

$ grunt -V
  1. 修改head源码
    编辑/usr/share/head/Gruntfile.js
$ vim /usr/share/head/Gruntfile.js
connect: {
    server: {
        options: {
            port: 9100,
            hostname: '0.0.0.0',
            base: '.',
            keepalive: true
        }
    }
}
  1. 运行head
$ npm install
$ grunt server
$ grunt server &  #后台启动
  1. 打开http://es-ip:9100查看
上一篇 下一篇

猜你喜欢

热点阅读