您的位置:首页 > 其它

ELK5.0 (Elasticsearch Logstash Kibana) head插件安装

2017-01-11 11:25 671 查看
安装完ELK之后想装一个head管理插件
发现ELK5.0+的版本 head插件无法在elasticsearch中直接安装了 需要自行下载安装

环境:
centOS 6.8
jdk1.8
Elasticsearch 5.0
Logstash 5.0
Kibana 5.0

1.去github下载代码,先要安装git
[root@linux1 ~]# yum -y install git

2.下载head
[root@linux1 ~]# git clone git://github.com/mobz/elasticsearch-head.git
[root@linux1 ~]# mv elasticsearch-head /usr/local/elasticsearch

3.下载安装nodejs、npm
下载
[root@linux1 ~]# wgethttps://nodejs.org/dist/v4.2.2/node-v4.2.2-linux-x64.tar.gz

解压
[root@linux1 ~]# tar -zxvf node-v4.2.2-linux-x64.tar.gz
[root@linux1 ~]# mv node-v4.2.2-linux-x64 /usr/local/

设置软链接
[root@linux1 ~]# ln -s /usr/local/node-v4.2.2-linux-x64/bin/node /usr/sbin/node

[root@linux1 ~]# ln -s /usr/local/node-v4.2.2-linux-x64/bin/npm /usr/sbin/npm

设置npm代理镜像
[root@linux1 ~]# npm config set registry https://registry.npm.taobao.org
[root@linux1 ~]# npm info underscore (如果上面配置正确这个命令会有字符串response)

4.安装grunt
[root@linux1 ~]# npm install -g grunt

设置软链接

[root@linux1 ~]# ln -s /usr/local/node-v4.2.2-linux-x64/lib/node_modules/grunt/bin/grunt /usr/sbin/grunt

5.安装head
进入head目录下
[root@linux1 ~]# cd /usr/local/elasticsearch/elasticsearch-head
[root@linux1 elasticsearch-head]# npm install

6.配置head
[root@linux1 elasticsearch-head]# vi _site/app.js
找到
this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://localhost:9200";

localhost改为对应的elasticsearch的ip

[root@linux1 elasticsearch-head]# vi Gruntfile.js
找到connect下的options,添加
connect: {

server: {

        options: {

          hostname: "0.0.0.0",                                         

                     port: 9100,

            base: '.',

            keepalive: true

        }  

    }  

}

7.修改elasticsearch配置
[root@linux1 elasticsearch]# vi elasticsearch.yml
在network下加入
http.host: 192.168.1.120
http.cors.enabled: true
http.cors.allow-origin: "*"

8.启动grunt
[root@linux1 elasticsearch]#cd elasticsearch-head
[root@linux1 elasticsearch-head]#grunt server &
Running "connect:server" (connect) task

Waiting forever...

Started connect web server on http://localhost:9100
然后用浏览器打开http://192.168.1.120:9100



成功打开 并且成功连接
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: