伺服器資訊:
CentOS6.7 x86_64 IP位址: 10.0.20.25
ELK版本:
elasticsearch-5.6.0.rpm
kibana-5.6.0-x86_64.rpm
logstash-5.6.0.rpm
x-pack版本:
x-pack-5.6.0.zip 先提前下載下傳好zip安裝包丢到/root目錄下,這樣離線安裝起來比較快。
ELK單節點的搭建步驟省略,可以參考http://lee90.blog.51cto.com/10414478/1968035。下面直接開始x-pack的安裝。
cd /usr/share/elasticsearch/
bin/elasticsearch-plugin install file:///root/x-pack-5.6.0.zip
<a href="https://s1.51cto.com/wyfs02/M01/A5/F9/wKioL1nGfMejIpIpAACpqNM4Goo784.png" target="_blank"></a>
/etc/init.d/elasticsearch restart
cd /usr/share/kibana/
bin/kibana-plugin install file:///root/x-pack-5.6.1.zip
/etc/init.d/kibana restart
cd /usr/share/logstash/
bin/logstash-plugin install file:///root/x-pack-5.6.1.zip
/etc/init.d/logstas hrestart
在浏覽器打開 http://10.0.20.25:5601 自動跳轉到登入頁面 (使用者名elastic 密碼 changeme)
我們開啟了xpack後,預設情況下通路叢集需要密碼了。
這會導緻packetbeat等上送資料失敗,提示401報錯。是以需要配置下。
以packetbeat為例,其他的我暫時用不到沒有去試驗。
vim /etc/packetbeat/packetbeat.yml 加上ES的使用者名和密碼
packetbeat.interfaces.device:any
packetbeat.protocols.mysql:
ports: [3306]
send_request: true
transaction_timeout: 30s
output.elasticsearch:
hosts: ["10.0.20.25:9200"]
username:"elastic"
password:"changeme"
work: 1
bulk_max_size: 50
timeout: 90
flush_interval: 1s
template.enabled: true
template.name:"packetbeat.template"
template.overwrite: true
index: test-mysql-%{+yyyy.MM.dd}
然後重新開機下packetbeat 即可正常的抓取資料存到ES叢集裡面。
(官網文檔位址:https://www.elastic.co/guide/en/beats/packetbeat/current/elasticsearch-output.html)
更詳細的用法可以參考文章: http://blog.csdn.net/pistolove/article/details/53838138
本文轉自 lirulei90 51CTO部落格,原文連結:http://blog.51cto.com/lee90/1968085,如需轉載請自行聯系原作者