ELK实时日志分析 Elasticsearch 插件

Posted by Sunday on 2018-01-30

Elasticsearch插件

环境

  • 系统:CentOS 7

部署

elasticsearch 5.x 不再支持插件,需运行独立

2.1 Head

插件作用:集群监制

1
2
3
4
5
6
7
8
9
10
11
12
yum install bzip2 unzip git -y
# git clone https://github.com/mobz/elasticsearch-head
wget https://github.com/mobz/elasticsearch-head/archive/master.zip
unzip master.zip
cd elasticsearch-head-master
npm install -ignore-scripts
npm run start
打开 http://192.168.11.31:9100/

vim /etc/elasticsearch/elasticsearch.yml
http.cors.enabled: true
http.cors.allow-origin: "*"

11

vim elasticsearch-head/_site/app.js
修改默认连接地址

1
sed -i 's!http://localhost:9200!http://192.168.11.31:9200!' _site/app.js

2.2 Bigdesk

插件作用:性能监控

git 获取bigdesk源码

1
2
3
cd /www
git clone https://github.com/hlstudio/bigdesk
## https://github.com/hlstudio/bigdesk/archive/master.zip

修改elasticsearch.yml,启用CORS
vim /etc/elasticsearch/elasticsearch.yml

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

配置nginx

1
2
3
4
5
6
7
8
vim /etc/nginx/vhost/bigdesk.conf 
server{
listen 80;
server_name 192.168.11.31;
index index.html;
root /www/bigdesk/_site;
access_log /var/log/nginx/bigdesk.log;
}

访问 bigdesk
11

3.3 Cerebro

插件作用:网络状态
Requirements
cerebro needs Java 1.8 or newer to run.
运行cerebro监听默认为0.0.0.0:9000,您可以在不同的主机和端口。

1
2
3
4
wget https://github.com/lmenezes/cerebro/releases/download/v0.7.2/cerebro-0.7.2.tgz
tar xf cerebro.tgz
cd cerebro-0.7.2
bin/cerebro -Dhttp.port=1234 -Dhttp.address=127.0.0.1

11