EFK安裝與建置(1/4) 前提: EFK是三個opensource組成,透過三個軟體的搭配去監控與分析資料。 為了蒐集不同類型與格式的log,進行資料的轉換(ETL),將數據呈現在不同的圖型上。 可以針對log去做監控和分析及記錄。 **安裝順序:1-1.Elasticsearch和1-2.Kibana -> 2.td-agent -> 3.curator** 我們會先安裝Elasticsearch和Kibana並把服務起起來,可以進入elastic後台之後,再去安裝和起td-agent服務,透過td-agent抓到log餵給elastic,最後透過curator去管理elastic的索引。 1. ELK 與 EFK 的差別 ELK: Elasticsearch + Logstash + Kibana EFK: Elasticsearch + Fluentd + Kibana 補充:Logstash在效能表現上不如Fluentd,慢慢的被Fluentd(td-agent)取代 2. 介紹 Fluentd:最底層蒐集log的服務,透過Fluentd先在Elasticsearch建立索引,並把資料餵給elastic Elasticsearch:可以儲存log,在建立索引之後,是一個可以快速搜尋log內資料的引擎 elasticsearch-curator:去管理elasticsearch索引的工具,因為每天都會讀log儲存進elastic,要定期清除 Kibana:圖形化的工具,把elastic的資料隨著時間排列,透過不同的圖表(圓餅圖、直方圖)呈現 補充: Fluentd 在 Linux 中的套件名稱為 td-agent 3. 安裝版本 Elasticsearch v7.12.0 elasticsearch-curator-5.8.1-1 Kibana v7.12.0 td-agent-3.7.1-0.el7 4. 安裝Elasticsearch和Kibana %rpm –install elasticsearch-7.12.0-x86_64.rpm %rpm --install kibana-7.12.0-x86_64.rpm 5. 設定Elasticsearch和Kibana %vi /etc/elasticsearch/elasticsearch.yml %cat /etc/elasticsearch/elasticsearch.yml (kibana待補充) 6. 設定xpack(進入或連進elastic需要密碼) 在Elasticsearch: 6-1.設定完要開啟xpack安全性設定 6-2.產生使用者帳號和密碼 6-3.curl localhost:9200 打echo API 在kibana: 6-4.使用kibana Utility 把連到Elasticsearch 帳密存在kibana 的keystore裡面 6-5.http://ServerIp:5601/login 啟動後可以看到後台 7. 7 8. 8 9. 9 10. 10 11.
×
Sign in
Email
Password
Forgot password
or
Sign in via Google
Sign in via Facebook
Sign in via X(Twitter)
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
Continue with a different method
New to HackMD?
Sign up
By signing in, you agree to our
terms of service
.