ELK 是 elasticsearch  logstash  kibana 的组合;

这里简单的说一下如何在centos6.x系统下安装,后续写如何使用这些软件;

 这里是根据官网推荐使用yum的方法安装的;


 1. elasticsearch

rpm --import https://packages.elastic.co/GPG-KEY-elasticsearc

   cat /etc/yum.repos.d/elsticsearch.repo

[elasticsearch-2.x]
name=Elasticsearch repository for 2.x packages
baseurl=http://packages.elastic.co/elasticsearch/2.x/centos
gpgcheck=1
gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch
enabled=1
yum install elasticsearch -y
#访问:  http://ip:9200

  安装各种插件

#安装 head
/usr/share/elasticsearch/bin/plugin install mobz/elasticsearch-head
#访问: 

#安装 kopf
/usr/share/elasticsearch/bin/plugin install lmenezes/elasticsearch-kopf
#访问:

#安装 bigdesk 
/usr/share/elasticsearch/bin/plugin install lukas-vlcek/bigdesk
#访问:http://ip:9200/_plugin/bigdesk

2. logstash

rpm --import https://packages.elastic.co/GPG-KEY-elasticsearc

cat /etc/yum.repos.d/logstash.repo

[logstash-2.2]
name=Logstash repository for 2.2.x packages
baseurl=http://packages.elastic.co/logstash/2.2/centos
gpgcheck=1
gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch
enabled=1
yum install logstash -y


3. kibana

rpm --import https://packages.elastic.co/GPG-KEY-elasticsearc

cat /etc/yum.repos.d/kibana.repo

[kibana-4.4]
name=Kibana repository for 4.4.x packages
baseurl=http://packages.elastic.co/kibana/4.4/centos
gpgcheck=1
gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch
enabled=1
yum install kibana -y
#访问
 http://ip:5601


下面说一下源码安装kibana

cd /usr/local/src
wget 
tar zxf  kibana-4.4.1-linux-x64.tar.gz
mv kibana-4.4.1-linux-x64 /usr/local
#建立软件链接
ln -s /usr/local/kibana-4.4.1-linux-x64 /usr/local/kibana
#修改配置
grep '^[a-z]' /usr/local/kibana/config/kibana.yml
server.port: 5601
server.host: "0.0.0.0"
elasticsearch.url: "http://192.168.1.82:9200"
kibana.index: ".kibana"
#启动
/usr/local/kibana/bin/kibana
若是想放在后台运行,可以使用nohub,或者screen
这里推荐使用screen;