elasticsearch+logstash+kibana 수집 로그

1. 배포 환경
      CentOS 5.4
selinux와 iptables 닫기
2. elasticsearch 배치
 yum install java-1.6.0-openjdk
 wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.1.noarch.rpm 
 rpm -ivh elasticsearch-1.4.1.noarch.rpm 
 
 # ..
node.name: "xd-174"
node.master: true
node.data: true
index.number_of_shards: 10
index.number_of_replicas: 0
path.data: /data1/elasticsearch,/data2/elasticsearch
network.host:  8.8.8.8                                       # 
transport.tcp.port: 9300
transport.tcp.compress: true
http.port: 9200
http.max_content_length: 100mb
http.enabled: true 
http.cors.enabled: true
 
 
 
 
  mkdir /data{1,2}/elasticsearch -p
  chown elasticsearch.elasticsearch data{1,2}/elasticsearch -p
 /chkconfig --add elasticsearch
  service elasticsearch start

3. 상태 보기 및 플러그인 설치
 : http://localhost:9200/_cluster/health 
 : http://localhost:9200/_nodes 

 : tail -f /var/log/elasticsearch/<>.log

플러그인 설치
# 1. head
/usr/share/elasticsearch/bin/plugin -install mobz/elasticsearch-head
# : http://ip:9200/_plugin/head/  

#2. bigdesk
/usr/share/elasticsearch/bin/plugin -install lukas-vlcek/bigdesk
# : http://ip:9200/_plugin/bigdesk/#nodes   

   
4. Logstash 배포
wget https://download.elasticsearch.org/logstash/logstash/packages/centos/logstash-1.4.2-1_2c0f5a1.noarch.rpm 
rpm -ivh logstash-1.4.2-1_2c0f5a1.noarch.rpm 


cat >>/etc/logstash/conf.d/syslog.conf < "172.16.20.174"
    port => "514"
  }
}
output {
  elasticsearch {
    host => "127.0.0.1"
  }
  stdout {
    codec => rubydebug
  }
}
EOF

5. Kibana 배포
yum install http php

wget https://download.elasticsearch.org/kibana/kibana/kibana-3.1.2.tar.gz 
mv kibana-3.1.2 /var/www/html/kibana

service httpd start
chkconfig httpd on

좋은 웹페이지 즐겨찾기