Code Monkey home page Code Monkey logo

elk_docker_swarm's Introduction

Deploy an ELK stack to Docker swarm

This specific guide is macOS M1 based.

Create and initialize the VMs

  1. Install UTM from here
  2. Download Ubuntu server for ARM
  3. Create several virtual machines as you wish, using the above image. Allocate 8 gigabytes per machine as elastic is memory intensive.
  4. Set the network mode to bridged. The other settings can be left at default. Remember to eject the the ISO installer before rebooting
  5. SSH into each created machine and run git clone https://github.com/shimi9276/elk_docker_swarm.git && cd elk_docker_swarm/
  6. run ./basic_installer.sh
  7. Exit and reconnect for the changes to be set

Create the swarm

  1. In the swarm-manager machine run docker swarm init. The output should include a join command with a token. Copy the command and paste in the other machines. Note you may need to add sudo to the command.
  2. In the swarm-manager machine run docker node ls and verify all the workers have been added.
  3. In the swarm-manager machine run ./ingress. This script resets the default ingress network (this is done as a result of a bug, see here)

Deploy the stack

  1. In the swarm-manager machine, set the .env file variables according to your pleasing, then run export $(cat .env | xargs). Note that the replica variable should eqaul the amount of workers in the swarm cluster
  2. run docker stack deploy -c <(docker-compose config) $DEPLOYMENT_NAME. Note that if may take some time for the stack to be up and running as it may need to download the images, give it a few minutes.
  3. Run docker service ls to see the stack status.
  4. Get the IP of one of the workers and head to port 5601

You should now be able to see Kibana and your logs!

elk_docker_swarm's People

Contributors

shimi9276 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.