Elasticsearch 5.1.1 head插件安装指南

1、下载安装包

下载Elasticsearch 5.1.1node

下载地址:https://www.elastic.co/downloads/elasticsearchlinux

zip和tar格式是各类系统都通用的,解压以后启动Elasticsearch便可。git

下载elasticsearch-headgithub

下载地址:https://github.com/mobz/elasticsearch-head,下载后解压缩。npm

2、安装node、npm、grunt

node下载地址nodejs.org/cors

$ node -v
v6.8.1

npm下载地址https://www.npmjs.comelasticsearch

$ npm -v
3.10.8

使用npm安装grunt:grunt

npm install –g grunt–cli

3、npm 安装依赖

到elasticsearch-head-master目录下,运行命令:.net

npm install

若是速度较慢或者安装失败,能够使用国内镜像:插件

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

4、修改Elasticsearch配置文件

编辑elasticsearch-5.1.1/config/elasticsearch.yml,加入如下内容:

http.cors.enabled: true
http.cors.allow-origin: "*"

5、修改Gruntfile.js

打开elasticsearch-head-master/Gruntfile.js,找到下面connect属性,新增hostname: ‘0.0.0.0’:

connect: {
        server: {
            options: {
                hostname: '0.0.0.0',
                port: 9100,
                base: '.',
                keepalive: true
            }
        }
    }

6、启动elasticsearch-head

在elasticsearch-head-master/目录下,运行启动命令:

grunt server

截图以下: 
这里写图片描述

访问9100端口: 
这里写图片描述

7、后台启动elasticsearch-head

后台启动grunt server命令;

nohup grunt server &exit

若是想关闭head插件,使用Linux查找进程命令:

ps aux|grep head

结束进程:

kill 进程号

这里写图片描述

相关文章
相关标签/搜索