From 043b0b135ab0c4cc4d78bb98ec57714a955a368e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zden=C4=9Bk=20Zaho=C5=99?= Date: Mon, 23 Apr 2018 18:13:26 +0200 Subject: [PATCH] =?UTF-8?q?P=C5=99id=C3=A1n=C3=AD=20mo=C5=BEnosti=20spu?= =?UTF-8?q?=C5=A1t=C4=9Bn=C3=AD=20pomoc=C3=AD=20Dockeru?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .docker/docker-compose.yml | 29 ++++++++++++++++++++++++ .docker/install/custom_elasticsearch.yml | 12 ++++++++++ .docker/install/filebeat.yml | 17 ++++++++++++++ .docker/install/kibana.yml | 8 +++++++ .gitignore | 3 +++ README.md | 9 ++++++++ 6 files changed, 78 insertions(+) create mode 100644 .docker/docker-compose.yml create mode 100644 .docker/install/custom_elasticsearch.yml create mode 100644 .docker/install/filebeat.yml create mode 100644 .docker/install/kibana.yml create mode 100644 .gitignore diff --git a/.docker/docker-compose.yml b/.docker/docker-compose.yml new file mode 100644 index 0000000..5a9bed7 --- /dev/null +++ b/.docker/docker-compose.yml @@ -0,0 +1,29 @@ +version: "3" + +services: + elasticsearch: + image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.2.4 + container_name: rtsoft_elasticsearch + ports: + - 9200:9200 + volumes: + - ./custom_elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml + + kibana: + image: docker.elastic.co/kibana/kibana-oss:6.2.4 + container_name: rtsoft_kibana + ports: + - 5601:5601 + volumes: + - ./kibana.yml:/usr/share/kibana/config/kibana.yml + depends_on: + - elasticsearch + + filebeat: + image: docker.elastic.co/beats/filebeat:6.2.4 + container_name: rtsoft_filebeat + volumes: + - ./filebeat.yml:/usr/share/filebeat/filebeat.yml + - ../log:/mnt/log + depends_on: + - elasticsearch diff --git a/.docker/install/custom_elasticsearch.yml b/.docker/install/custom_elasticsearch.yml new file mode 100644 index 0000000..e91932a --- /dev/null +++ b/.docker/install/custom_elasticsearch.yml @@ -0,0 +1,12 @@ +# Ukázkový konfigurační soubor z https://github.com/elastic/elasticsearch-docker/blob/master/build/elasticsearch/elasticsearch.yml + +cluster.name: "docker-cluster" +network.host: 0.0.0.0 + +# minimum_master_nodes need to be explicitly set when bound on a public IP +# set to 1 to allow single node clusters +# Details: https://github.com/elastic/elasticsearch/pull/17288 +discovery.zen.minimum_master_nodes: 1 + +# Doporučené nastavení pro vývoj (https://www.elastic.co/guide/en/elasticsearch/reference/6.2/docker.html#docker-cli-run-dev-mode) +discovery.type: single-node diff --git a/.docker/install/filebeat.yml b/.docker/install/filebeat.yml new file mode 100644 index 0000000..11410cb --- /dev/null +++ b/.docker/install/filebeat.yml @@ -0,0 +1,17 @@ +# Ukázkový konfigurační soubor z https://github.com/elastic/beats-docker/blob/master/build/filebeat/config/filebeat.yml + +filebeat.config: + prospectors: + path: ${path.config}/prospectors.d/*.yml + reload.enabled: false + modules: + path: ${path.config}/modules.d/*.yml + reload.enabled: false + +processors: +- add_cloud_metadata: + +output.elasticsearch: + hosts: ['elasticsearch:9200'] + username: elastic + password: changeme diff --git a/.docker/install/kibana.yml b/.docker/install/kibana.yml new file mode 100644 index 0000000..f3985ee --- /dev/null +++ b/.docker/install/kibana.yml @@ -0,0 +1,8 @@ +# Ukázkový konfigurační soubor z https://github.com/elastic/kibana-docker/blob/master/build/kibana/config/kibana-oss.yml + +--- +# Default Kibana configuration from kibana-docker. + +server.name: kibana +server.host: "0" +elasticsearch.url: http://elasticsearch:9200 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0d2cf7d --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.docker/custom_elasticsearch.yml +.docker/kibana.yml +.docker/filebeat.yml diff --git a/README.md b/README.md index 26080e0..d423e4f 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,15 @@ Pro spuštění Kibany musíte mít zároveň spuštěný Elasticsearch. Chcete- Před spuštěním Filebeatu upravte konfigurační soubor filebeat.yml. Poté spusťte Filebeat příkazem filebeat.exe. Zda vám vše běží můžete průběžně kontrolovat přes prohlížeč (localhost:9200 pro Elastisticsearch, localhost:5601 pro Kibanu). +### Spuštění pomocí Dockeru: +1. Zkopírovat všechny konfigurační soubory z ```.docker/install``` o úroveň výš. +2. + ``` + cd .docker + docker-compose up + ``` +3. V prohlížeči otevřít [Kibanu](http://localhost:5601). + ### Úkol pro Elasticsearch fandy: Nahrajte všechny soubory ze složky log do elasticsearche za použití filebeatu. Jakmile začne Filebeat zpracovávat data, tak se v Kibaně objeví nově vytvořený index.