diff --git a/README.md b/README.md index e5352f2..78258de 100644 --- a/README.md +++ b/README.md @@ -70,3 +70,5 @@ http://localhost:9200 * [Hands on Elasticsearch](https://medium.com/@maxy_ermayank/hands-on-elasticsearch-8fa59d8aebfc) * [Elasticsearch Resources](https://medium.com/@maxy_ermayank/elasticsearch-resources-27d24f01c1dc) * [Open Distro Elasticsearch](https://medium.com/@maxy_ermayank/tl-dr-aws-open-distro-elasticsearch-fc642f0e592a) + +## diff --git a/docker-compose-elastic-kibana.yaml b/docker-compose-elastic-kibana.yaml new file mode 100644 index 0000000..7c98f37 --- /dev/null +++ b/docker-compose-elastic-kibana.yaml @@ -0,0 +1,113 @@ + +version: '3.7' +services: + elasticsearch: + image: docker.elastic.co/elasticsearch/elasticsearch:7.8.0 + container_name: elasticsearch1 + environment: + - node.name=elasticsearch1 + - cluster.name=docker-cluster + - cluster.initial_master_nodes=elasticsearch1 + - bootstrap.memory_lock=true + - "ES_JAVA_OPTS=-Xms256M -Xmx256M" + - http.cors.enabled=true + - http.cors.allow-origin=* + - network.host=_eth0_ + ulimits: + nproc: 65535 + memlock: + soft: -1 + hard: -1 + cap_add: + - ALL + deploy: + replicas: 1 + update_config: + parallelism: 1 + delay: 10s + resources: + limits: + cpus: '1' + memory: 1G + reservations: + cpus: '1' + memory: 256M + restart_policy: + condition: on-failure + delay: 5s + max_attempts: 3 + window: 10s + volumes: + - type: volume + source: logs + target: /var/log + - type: volume + source: esdata1 + target: /usr/share/elasticsearch/data + networks: + - elastic + - ingress + ports: + - 9200:9200 + - 9300:9300 + kibana: + image: docker.elastic.co/kibana/kibana:7.8.0 + container_name: kibana + environment: + SERVER_NAME: localhost + ELASTICSEARCH_URL: http://elasticsearch1:9200/ + ports: + - 5601:5601 + volumes: + - type: volume + source: logs + target: /var/log + ulimits: + nproc: 65535 + memlock: + soft: -1 + hard: -1 + cap_add: + - ALL + deploy: + replicas: 1 + update_config: + parallelism: 1 + delay: 10s + resources: + limits: + cpus: '1' + memory: 256M + reservations: + cpus: '1' + memory: 256M + restart_policy: + condition: on-failure + delay: 30s + max_attempts: 3 + window: 120s + networks: + - elastic + - ingress +volumes: + esdata1: + esdata2: + esdata3: + logs: + +networks: + elastic: + ingress: + +# configs: +# auditbeat_config: +# file: configs/auditbeat.docker.yml +# filebeat_config: +# file: configs/filebeat.docker.yml +# heartbeat_config: +# file: configs/heartbeat.docker.yml +# metricbeat_config: +# file: configs/metricbeat.docker.yml +# packetbeat_config: +# file: configs/packetbeat.docker.yml + diff --git a/lab-vagrant/README.md b/lab-vagrant/README.md new file mode 100644 index 0000000..55b856f --- /dev/null +++ b/lab-vagrant/README.md @@ -0,0 +1,2 @@ +Exit 78 on docker => grep vm.max_map_count /etc/sysctl.conf +sudo sysctl -w vm.max_map_count=262144 diff --git a/lab-vagrant/Vagrantfile b/lab-vagrant/Vagrantfile new file mode 100644 index 0000000..29526b8 --- /dev/null +++ b/lab-vagrant/Vagrantfile @@ -0,0 +1,22 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure("2") do |config| + config.vm.define "docker" do |docker| + docker.vm.box = "geerlingguy/centos7" + docker.vm.network "private_network", type: "dhcp" + docker.vm.hostname = "docker" + docker.vm.provider "virtualbox" do |v| + v.name = "docker" + v.memory = 3024 + v.cpus = 2 + end + docker.vm.provision :shell do |shell| + shell.path = "install_docker.sh" + end + end +end + + + + diff --git a/lab-vagrant/install_docker.sh b/lab-vagrant/install_docker.sh new file mode 100644 index 0000000..4e9c9b4 --- /dev/null +++ b/lab-vagrant/install_docker.sh @@ -0,0 +1,10 @@ +#!/bin/bash +sudo yum -y update + +# install docker +curl -fsSL https://get.docker.com -o get-docker.sh +sh get-docker.sh +sudo usermod -aG docker vagrant +sudo systemctl enable docker +sudo systemctl start docker +echo "For this Stack, you will use $(ip -f inet addr show enp0s8 | sed -En -e 's/.*inet ([0-9.]+).*/\1/p') IP Address"