Difference between revisions of "Centralized logging in swarm"
(→Telepítés) |
(→=Elastic Search) |
||
Line 33: | Line 33: | ||
− | ==Elastic Search= | + | ==Elastic Search== |
Az Elastichsearch docker image a https://www.docker.elastic.co/ oldaláról tölthető le | Az Elastichsearch docker image a https://www.docker.elastic.co/ oldaláról tölthető le |
Revision as of 18:57, 12 September 2018
Bevezető
ElasticSearch
https://www.elastic.co/products/elasticsearch
ElasticSearch established itself as one of the best databases for real-time search and analytics. It is distributed, scalable, highly available, and provides a sophisticated API.
Logstash
https://www.elastic.co/products/logstash
LogStash allows us to centralize data processing. It can be easily extended to custom data formats and offers a lot of plugins that can fulfill almost any need. Finally
Ezt az elastic cég csinálta, ugyan az aki az elasticPath-t.
LogSpout is a log router for Docker containers that runs inside Docker. It attaches to all containers on a host, then routes their logs wherever we want. It also has an extensible module system. It's a mostly stateless log appliance. It's not meant for managing log files or looking at history. It is just a tool to get your logs out to live somewhere else, where they belong.
Kibana
https://www.elastic.co/products/kibana
Kibana is an analytics and visualization platform with intuitive interface sitting on top of ElasticSearch.
Telepítés
docker network create --driver overlay elk
Elastic Search
Az Elastichsearch docker image a https://www.docker.elastic.co/ oldaláról tölthető le
Itt van a telepítési leírás:
https://www.elastic.co/guide/en/elasticsearch/reference/6.4/docker.html
Ahogy azt már sokszor említettem, a konténerek legfelső, írható rétegét, nem szabad írás intenzíven használni, mivel az ottani overlay2 fájlrendszer nagyon lassan tudja csak kezelni a változásokat, legrosszabb esetben minden image-et végig kell nézzen, ami a konténert alkotja, hogy megtaláljon egy fájlt. Minden írás intenzív műveletet volume-okon kell elvégezni, azok arra lettek kitalálva.
Az ElsaticSearch konténer két mappáját fogjuk a Netshare volume plugin-al felcsatolni az NFS megosztásra. Az egyik az adatbázis mappa, a másik a config mappa, hogy
Elsőként az ElasticSearch image-et fel fogjuk standalone docker konténerként telepíteni hogy kimásoljuk belőle a konfigurációs mappájának a tartalmát, amit az NFS elasticsearch/config mappájába fogunk másolni, hogy ezt majd felcsatoljuk a swarm service alá.
# docker run -d --name elasticsearch \ -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" \ docker.elastic.co/elasticsearch/elasticsearch:6.4.0 # docker cp -L elasticsearch:/usr/share/elasticsearch/config/ /home/adam/Projects/DockerCourse/persistentstore/elasticsearch/ # chmod 777 /home/adam/Projects/DockerCourse/persistentstore/elasticsearch/config # mkdir /home/adam/Projects/DockerCourse/persistentstore/elasticsearch/data # docker rm -f elasticsearch
Note
Az elasticsearch image elég nagy, 1 Giga körül van, így fontos, hogy legyen elég lemezterület az összes node-on. A base image CentOS 7.5