Monitoring with ELK
Ming-der Wang
ming@log4analytics.com


#DevOps 系列課程 (ㄧ)
TurboTeam 集先鋒科技
#DevOps = ~CA(L)MS
C(ulture) - 文化
A(utomation) - 自動化
L(ean) - 敏捷
M(etric) - 監控
S(haring) - 分享

M(onitoring & Measuring)
- 監控與量測
- Metric - CPU, Memory, Disk, Networking
- Logs - Application Logs, System Logs...
- SNMP - devices, switches...
- Security - authd.log, auth.log, fail2ban.log
- IoT - any data format with timestamps
傳統的 monitoring 工具

傳統的 website 架構

傳統的 website 軟體

現在的 website 架構

現在的 website 軟體

未來的 docker 世界

ELK = E(lasticsearch)
+ L(ogstash)
+ K(ibana)

<- this is an
elk as well
Elasticsearch 漸漸被廣泛使用

這 3 年Elasticsearch 變成首選

ELK 用在哪裡?

ELK 也能這樣用

用 docker
大量部署
ELK 最簡單的安裝架構

... 多台
ELK 最簡單的安裝架構

... 多台
以 IIS Web Server 為例



ELK log 的資料流

Redis 當 buffer

logstash
redis
Logstash config

logstash config 檔的位置

/opt/logstash/bin/logstash -f turboteam-iislog-cell.conf
/opt/logstash/bin/logstash -f turboteam-iislog-cell.conf --configtest
Configuration OK
Logstash config 範例

Elasticsearch Cluster 架構

Text
-
indexing
-
查詢主機
-
分散式資料庫
-
cluster 架構
-
自動 shards
-
自動 replicas
- REST API
4 nodes 的實體架構

資料複製與 sharding

elasitcsearch 設定檔
修改 /etc/elasticsearch/elasticsearch.yml
sudo service elasticsearch restart

Elasticsearch Plugins
- HQ, head, BigDesk, SQL ...
安裝 plugin 指令:
cd /usr/share/elasticsearch
sudo bin/plugin install royrusso/elasticsearch-HQ
sudo bin/plugin install mobz/elasticsearch-head
sudo bin/plugin install lukas-vlcek/bigdesk
http://10.1.100.121:9200/_plugin/hq

http://10.1.100.121:9200/_plugin/head/

Q & A
TurboTeam 集先鋒科技

#DevOps 系列課程 (一)
By Ming-der Wang
#DevOps 系列課程 (一)
- 1,535