Page 1
LINUX.CONF.AU21-25 January 2019 | Christchurch | NZ
The Linux of Things#LCA2019@linuxconfau
Awesome MonitoringInfrastructure Using the
Elastic Stack
LINUX.CONF.AU21-25 January 2019 Christchurch, NZ
The Linux of Things | #LCA2019 | @linuxconfau
Mark Walkom @warkolmKaren Carcamo @karencfv
www.elastic.co
Page 2
LINUX.CONF.AU21-25 January 2019 | Christchurch | NZ
The Linux of Things#LCA2019@linuxconfau
LINUX.CONF.AU21-25 January 2019 Christchurch, NZ
The Linux of Things | #LCA2019 | @linuxconfau
Please install Docker :)
docker pull docker.elastic.co/elasticsearch/elasticsearch:6.5.4docker.elastic.co/elasticsearch/elasticsearch:6.5.4-oss
docker pull docker.elastic.co/kibana/kibana:6.5.4docker pull docker.elastic.co/kibana/kibana:6.5.4-oss
Commands at https://go.es.io/2MjxC9MSlides at https://go.es.io/2FN9ufo
Page 5
55
https://github.com/markwalkom/bloomsky-on-elastic
Page 6
6
Elastic Stack Elasticsearch, Kibana, Beats, and Logstash
Page 7
Store, Search, & Analyze
Visualize & Manage
Ingest
Elastic Stack
Kibana
Elasticsearch
Beats Logstash
Elastic Stack
Page 8
● Scalable
● Real-time
● Highly available
● Developer-friendly
● Versatile storage
● Query & aggregations
ElasticsearchHeart of the Elastic Stack
Page 9
MACHINE LEARNING
GRAPH
TEMPORAL
QUERY
GEOSPATIAL
AGGREGATION
Page 10
● Visualize and explore
● Manage and monitor
● Share and report
● Developer tools
● Time-series analysis
● Geospatial exploration
KibanaWindow into the Elastic Stack
Page 11
11
All the visualizations you expect, and then some more
Page 12
12
OOTB dashboards for 50+ (and growing) data sources
Page 13
● Ship from any source
● Transform at the edge
● Docker and k8s ready
● Cloud metadata enrichment
● 70+ community Beats
● 50+ modules
BeatsLightweight data shippers
Page 14
FILEBEATLog Files
METRICBEATMetrics
PACKETBEATNetwork Data
WINLOGBEATWindow Events
HEARTBEATUptime Monitoring
AUDITBEATAudit Data
FUNCTIONBEATServerless Monitoring
Plus a growing set of community Beats
Page 15
● Flexible ETL engine
● Parse & transform data
● Many inputs & outputs
● Horizontally scalable
● 200+ pluginsLogstash
Data processing pipeline
Page 16
ModulesData to dashboards in 5 minutes
Turnkey for many formatsAutomated data parsing Out of the box dashboardsPreconfigured ML jobs
Page 17
17
Let’s get started
Page 18
18
Let’s Install Elasticsearch
docker pull docker.elastic.co/elasticsearch/elasticsearch:6.5.4
Or
docker pull docker.elastic.co/elasticsearch/elasticsearch-oss:6.5.4
• https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docker.html
• https://www.docker.elastic.co/
• https://hub.docker.com/_/elasticsearch
Page 19
19
Let’s Run Elasticsearch
docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:6.5.4
Or
docker run -d -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:6.5.4
• https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docker.html
Page 20
20
version: '2.2'services: elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch:6.5.4 volumes: - esdata:/usr/share/elasticsearch/data ports: - 9200:9200
volumes: esdata: driver: local
Let’s docker-compose Elasticsearch
Page 21
21
Let’s (just) Elasticsearch
curl 0:9200/_cat/
curl 0:9200/_cat/health
curl 0:9200/_cat/indices?v
• https://www.elastic.co/guide/en/elasticsearch/reference/6.5/cat.html
Page 22
22
docker pull docker.elastic.co/kibana/kibana:6.5.4
Or
docker pull docker.elastic.co/kibana/kibana-oss:6.5.4
• https://www.elastic.co/guide/en/kibana/6.5/docker.html
• https://www.docker.elastic.co/
• https://hub.docker.com/_/kibana
Kibana Install
Page 23
23
docker run docker.elastic.co/kibana/kibana:6.5.4 -p 5601:5601 -e "elasticsearch.url=localhost:9200"
• (wait for it)• Open http://localhost:5601/
Kibana Run
Page 24
24
kibana: image: docker.elastic.co/kibana/kibana:6.5.4 links: - elasticsearch ports: - 5601:5601
• Use the complete Docker compose file in the gist
Let’s docker-compose Kibana
Page 25
25
• Just run that command• Alternatively;
docker-compose up -d
docker-compose up
Page 27
2727
Metricbeat
https://www.elastic.co/guide/en/beats/metricbeat/current/index.html
Page 28
28
• Download the binary• Extract
./metricbeat
• STOP!
./metricbeat setup --help
./metricbeat modules --help
Metricbeat Install and Run
Page 29
29
./metricbeat modules list
./metricbeat setup --template -E output.logstash.enabled=false -E 'output.elasticsearch.hosts=["localhost:9200"]'
./metricbeat setup --dashboards
./metricbeat
• Enable the system module• See also https://go.es.io/2T44qWN
Metricbeat Install and Run
Page 30
3030
Filebeat
https://www.elastic.co/guide/en/beats/filebeat/current/index.html
Page 31
31
• Download the binary• Extract
./filebeat
• Remember
./filebeat setup --help
./filebeat modules --help
Filebeat Install and Run
Page 32
32
./filebeat modules list
./filebeat setup --template -E output.logstash.enabled=false -E 'output.elasticsearch.hosts=["localhost:9200"]'
./filebeat setup --dashboards
./filebeat
• Enable the system module• See also https://go.es.io/2T44qWN
Filebeat Install and Run
Page 33
3333
Let’s kick it up a notch
Page 34
3434
Metricbeat - Enable the docker module
Filebeat - Enable the docker input
Page 35
3535
Let’s analyse Elasticsearch traffic!
Page 36
3636
Packetbeat
https://www.elastic.co/guide/en/beats/packetbeat/current/index.html
Page 37
37
• Download the binary• Extract
./packetbeat
• Remember
./packetbeat setup --help
./packetbeat modules --help
Packetbeat Install and Run
Page 38
38
./packetbeat modules list
./packetbeat setup --template -E output.logstash.enabled=false -E 'output.elasticsearch.hosts=["localhost:9200"]'
./packetbeat setup --dashboards
./packetbeat
• See also https://go.es.io/2T44qWN
Metricbeat Install and Run
Page 39
3939
Heartbeat
https://www.elastic.co/guide/en/beats/heartbeat/current/index.html
Page 40
40
• Download the binary• Extract
./heartbeat
• Remember
./heartbeat setup --help
./heartbeat modules --help
Heartbeat Install and Run
Page 41
41
./heartbeat modules list
./heartbeat setup --template -E output.logstash.enabled=false -E 'output.elasticsearch.hosts=["localhost:9200"]'
./heartbeat setup --dashboards
./heartbeat
• See also https://go.es.io/2T44qWN
Heartbeat Install and Run
Page 42
4242
Community beatsLogstash!Elasticsearch Ingest[Heart|Winlog|DIY]beatAPMDashboards
Page 43
LINUX.CONF.AU21-25 January 2019 | Christchurch | NZ
The Linux of Things#LCA2019@linuxconfau
Whakawhetai Koe!
LINUX.CONF.AU21-25 January 2019 Christchurch, NZ
The Linux of Things | #LCA2019 | @linuxconfau