zoukankan      html  css  js  c++  java
  • ELK 学习笔记之 elasticsearch head插件安装

    elasticsearch head插件安装:

    准备工作:

    • 安装nodejs和npm

    https://nodejs.org/en/download/

     

    node-v6.11.2-linux-x64.tar.xz

      • 由于是xz压缩文件,所以要先安装

    yum -y install xz

    $xz -d ***.tar.xz

    $tar -xvf  ***.tar

      • 配置环境变量

    # set node environment

    export NODE_HOME=/usr/local/node-v6.11.2-linux-x64

    export PATH=$PATH:$NODE_HOME/bin

      • 验证环境变量是否生效

    [sky@hadoop1 bin]$ node -v

    v6.11.2

    [sky@hadoop1 bin]$ npm -v

    3.10.10

      • 使用npm安装grunt

    npm install -g grunt-cli

    grunt -version

    • 下载elasticsearch-head

    https://github.com/mobz/elasticsearch-head

      • 解压zip上传

     

      • 安装

     

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

     

    npm install

     

    如果速度较慢或者安装失败,可以使用国内镜像:

     

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

    cnpm install

      • 修改&elasticsearch-head插件源码修改

    修改elasticsearch.yml,增加跨域的配置(需要重启es才能生效)

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

    编辑head/Gruntfile.js,修改服务器监听地址,增加hostname属性,将其值设置为*

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

    编辑head/_site/app.js,修改head连接es的地址,将localhost修改为esIP地址

    this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://192.168.1.151:9200";
      • 启动elasticsearch-head

    nohup grunt server &

     

    大功告成!!!不容易啊。

     

  • 相关阅读:
    uboot串口与标准输入输出代码详解
    uboot打开Debug
    git添加公钥后报错sign_and_send_pubkey: signing failed: agent refused operation的解决办法
    git 代码管理工具,很不错,值得推荐
    Ubuntu 压缩解压命令
    OMAPL138调试笔记
    网络
    关于运放
    win7 linux 双系统删除linux & 双系统安装
    dedecms 蜘蛛抓取设置 robots.txt
  • 原文地址:https://www.cnblogs.com/AK47Sonic/p/7440860.html
Copyright © 2011-2022 走看看