Code Monkey home page Code Monkey logo

docker-elk's Introduction

Yet another ELK

Yet another ELK is a set of notes for me to remember how to run up a Docker based solution for Elasticsearch, Logstash and Kibana as an instant platform for timeseries (mostly) based Analytics.

Installing dependencies

Docker 1.3+ - https://docs.docker.com/installation/ubuntulinux/ docker-compose 1.2.0+ - https://docs.docker.com/compose/

Install Docker and Docker Compose, and then build a base image - I don't want to rely on anyone elses so I cook mine like thus:

 #!/bin/sh

 # build a minimal image and import into private Docker registry
 sudo rm -rf trusty64

 debootstrap --include=ubuntu-minimal --components main,universe trusty trusty64
 cd trusty64 && sudo chroot .
 apt-get install wget && wget https://apt.puppetlabs.com/puppetlabs-release-trusty.deb && sudo dpkg -i puppetlabs-release-trusty.deb && rm puppetlabs-release-trusty.deb && sudo apt-get update
 apt-get install software-properties software-properties-common
 apt-get install puppet
 gem install hiera-eyaml
 perl -i -ne 'print unless /templatedir/' /etc/puppet/puppet.conf
 cd ..
 IID=`sudo tar -C trusty64 -c . | sudo docker import - trusty`
 sudo docker images
 sudo docker tag $IID dragon.local.net:5000/ubuntu
 sudo docker push dragon.local.net:5000/ubuntu

build individual containers

The four containers required can be built individually - note, the persistent storage for Elasticseach is in a data only container - elasticdata:

  • elasticdata - cd elasticdata && ./run.sh
  • elasticsearch - cd elasticsearch && ./build.sh && ./run.sh
  • logstash - cd elasticsearch && ./build.sh && ./run.sh
  • kibana - cd elasticsearch && ./build.sh && ./run.sh

Have a look at the different build.sh and run.sh scripts to see how the containers are linked together

control everything with docker-compose

Docker compose enables the orchestration of the docker containers to be managed from one place (very convenient!). We still need to build the images and create the persistent data storage in a data only container - elasticdata:

  • elasticdata - cd elasticdata && ./run.sh
  • build images - for i in elasticsearch logstash kibana; do echo "Building $i..."; cd $i && ./build.sh && cd ..; done
  • launch with docker -compose - docker-compose up

Finally - use logstash to pour logs into Elasticsearch - logstash config files are kept in logstash/config, and the logstash/data directory is mounted as a volume /data in the logstash container so that it can be used a means of communication - see logstash/config/test.conf for an example

docker-elk's People

Contributors

piersharding avatar

Stargazers

 avatar

Watchers

 avatar  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.