1. 程式人生 > >K8S 日誌收集(五):head插件安裝

K8S 日誌收集(五):head插件安裝

http option 文件 -h earch master url ID app.js

下載node

wget https://npm.taobao.org/mirrors/node/v6.9.5/node-v6.9.5-linux-x64.tar.gz

tar xf node-v6.9.5-linux-x64.tar.gz

添加環境變量

[root@kibana ~]# cat /etc/profile
export NODE_HOME=/root/node-v6.9.5-linux-x64
export PATH=$PATH:${NODE_HOME}/bin
export NODE_PATH=${NODE_HOME}/lib/node_modules

[root@kibana ~]# source /etc/profile

修改npm倉庫

npm config set registry https://registry.npm.taobao.org
npm config set disturl https://npm.taobao.org/dist

下載head插件

https://github.com/mobz/elasticsearch-head/archive/master.zip

unzip elasticsearch-head-master.zip

安裝grunt

cd elasticsearch-head-master
npm install -g grunt-cli
npm install

修改head插件配置文件

Gruntfile.js 修改

[root@kibana elasticsearch-head-master]# vi Gruntfile.js
    90                  connect: {
    91                          server: {
    92                                  options: {
    93                                          port: 9100,
    94                                          base: ‘.‘,
    95                                          keepalive: true
    96                                  }
    97                          }
    98                  }
    99
   100          });

_site/app.js 修改

[root@kibana _site]# vi app.js
   4354                         this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://192.168.19.93:9200";

啟動head

cd /root/elasticsearch-head-master
grunt server 

修改連接es節點的配置,允許head訪問

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

K8S 日誌收集(五):head插件安裝