ElasticSearch安装及HEAD插件配置

1. 安装 ElasticSearch

  直接下载 zip 包解压即可,假设解压到 E:\ESTool\elasticsearch-5.6.3

 

2. 安装 nodejs 和 npm

  head 插件本身是一个 nodejs 工程,需要安装 npm,用来安装依赖的包

 

3. 安装 grunt-cli(用于运行 head)

  全局安装 grunt-cli,使用如下命令:

    npm install -g grunt-cli (第二步中若配置了npm 的环境变量,则在任意目录下执行皆可)

 

4. 安装head 插件

  a. 下载 head 源码

    git clone https://github.com/mobz/elasticsearch-head.git E:\ESTool\elasticsaerch-head

  b. 安装插件

    cd E:\ESTool\elasticsaerch-head

    npm install

 

5. 修改 head 配置

  打开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. 修改 ES 的配置,增加跨域的配置,使得head 插件能够访问到 es

  修改elasticsearch.yml文件,增加如下内容:

  http.cors.enabled: true

  http.cors.allow-origin: "*"
 

7. 启动 es 和 head插件

  cd elasticsearch-5.6.3/ && ./bin/elasticsearch.bat

  cd elasticsearch-head/ && grunt server

  head 插件监听在 9100 端口

  通过 localhost:9100即可访问

 

-----------------

      END

-----------------

 

posted @ 2017-10-28 22:07  byron_nj  阅读(4193)  评论(0编辑  收藏  举报