DevOps Buzz
Search…
Bash / Shell
Bitbucket
Distros
Elasticsearch
General
Guidelines / Standards
microk8s
Prometheus
RabbitMQ
VirtualBox
ELK
Elastichsearch, Logstash and Kibana

Deploy using Docker

Elasticsearch

The vm.max_map_count kernel setting needs to be set to at least 262144 for production use
1
sysctl -w vm.max_map_count=262144
Copied!
Deploy elasticsearch:
1
docker run \
2
-tid \
3
--name elasticsearch \
4
-p 9200:9200 \
5
-p 9300:9300 \
6
docker.elastic.co/elasticsearch/elasticsearch:6.7.0
Copied!

Kibana

1
docker run \
2
-tid \
3
--name kibana \
4
--net=host \
5
-p 5601:5601 \
6
docker.elastic.co/kibana/kibana:6.7.0
Copied!
If you want to mount the config file, use:
--volume="/your-path/kibana.yml:/usr/share/kibana/config/kibana.yml:ro" \

Deploy using docker-compose

Run:
1
git clone https://github.com/deviantony/docker-elk.git
2
cd docker-elk
3
docker-compose up
Copied!

Deploy Filebeat

Create the config file:
1
sudo nano filebeat.docker.yml
Copied!
Paste
1
filebeat:
2
config:
3
modules:
4
path: ${path.config}/modules.d/*.yml
5
reload.enabled: false
6
7
autodiscover:
8
providers:
9
- type: docker
10
hints.enabled: true
11
12
prospectors:
13
- input_type: log
14
paths:
15
- /var/log/*.log
16
17
output.logstash:
18
hosts: ["localhost:5044"]
19
20
#output.elasticsearch:
21
# hosts: ["http://<HOST>:<IP>"]
22
23
logging:
24
files:
25
rotateeverybytes: 10485760 # = 10MB
Copied!
Run the container:
1
docker run -tid \
2
--name=filebeat \
3
--user=root \
4
--volume="$(pwd)/filebeat.docker.yml:/usr/share/filebeat/filebeat.yml:ro" \
5
--volume="/var/lib/docker/containers:/var/lib/docker/containers:ro" \
6
--volume="/var/run/docker.sock:/var/run/docker.sock:ro" \
7
docker.elastic.co/beats/filebeat:6.7.0 filebeat
Copied!
Access Kibana: http://localhost:5601
Go to Management -> Index Patterns and create your index.