1. 程式人生 > >搭建elasticsearch+logstash+kibana

搭建elasticsearch+logstash+kibana

版本:

es:2.4.0
logstash:2.4.0
kibana:4.6.1

logstash

1.下載

https://download.elastic.co/logstash/logstash/logstash-2.4.0.tar.gz

2.解壓

tar -xf logstash-2.4.0.tar.gz

3.配置conf/logstash.conf

input {
    stdin {}
}

filter {

}

output {
    elasticsearch { hosts => ["120.55.113.22:9200"] }
}

4.測試

bin/logstash -e 'input{stdin{}} output{stdout{codec=>rubydebug}}'

5.啟動

bin/logstash -f conf/logstash.conf

elasticsearch

1.下載

https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.4.0/elasticsearch-2.4.0.tar.gz

2.解壓

tar -xf elasticsearch-2.4.0.tar.gz

3.配置config/elasticsearch.yml

 cluster.name: my-es
 node.name: node-es-1
 path.data: /home/es/elasticsearch-2.4.0/data
 path.logs: /home/es/elasticsearch-2.4.0/logs
 network.host: 120.55.113.22
 http.port: 9200

4.啟動

bin/elasticsearch
注意:如果報Exception in thread "main" java.lang.RuntimeException: don't run elasticsearch as root異常。解決方案:新建使用者和使用者組,修改elasticsearch-2.4.0目錄的使用者許可權
adduser username groupname
chown -R username:groupname elasticsearch-2.4.0

5.測試

http://127.0.0.1:9200/

kibana

1.下載

https://download.elastic.co/kibana/kibana/kibana-4.6.1-linux-x86.tar.gz

2.解壓

tar -xf kibana-4.6.1-linux-x86.tar.gz

3.配置

server.host: "120.55.113.22"
server.port: 5601
elasticsearch.url: "http://120.55.113.22:9200"

4.啟動

bin/kibana

marvel外掛

這裡寫圖片描述