Giter Site home page Giter Site logo

developerlee79 / swarm-monitoring-stack Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 22 KB

All-in-one monitoring stack with docker swarm

Shell 100.00%
docker beats cadvisor elasticsearch elk filebeat grafana kafka kibana logstash monitor monitoring node-exporter prometheus swarm zookeeper

swarm-monitoring-stack's Introduction

Docker Swarm Monitoring Stack

All-in-one monitoring stack with docker swarm

Stack

Feature

  • "Elastic" log monitoring pipeline with Elastic Stack and Kafka
    • Full support for global deploy Elasticsearch cluster without any hard coding
    • Full support for Elasticsearch security
    • Integrate with Elastic Agent & Fleet
    • Logstash configuration example
    • Nginx Proxy for Elasticsearch
    • Real-time alteration system using ElastAlert
  • Monitor Docker Swarm nodes & services with Prometheus & Grafana
    • Collect Swarm metrics with Node exporter & cAdvisor
    • Two AWESOME basic dashboard
  • Shell Script for easy use of monitoring stack

Setup

Require: Linux with Docker & Docker Compose installed and Docker Swarm cluster

If you don't know how, BASIC_GUIDE.md will help you.

1. Increase vm.max_map_count for Elasticsearch

vi /etc/sysctl.conf

# systemctl.conf
vm.max_map_count=262144

sysctl -p

2. Set daemon.json to expose docker daemon metrics for monitor container

vi /etc/docker/daemon.json

# daemon.json
{
  "metrics-addr" : "0.0.0.0:9323",
  "experimental" : true
}

3. Run Filebeat at server to be monitored

Read filebeat/README.md

4. Run Kafka server

Read kafka/README.md

5. Set Logstash input to Kafka server

You must change the kafka bootstrap_servers in logstash.yml to the IP of the kafka server.

# logstash/config/logstash.yml

input {
    kafka {
        bootstrap_servers => "your_kafka_server_ip:9094"
        topics => ["test_topic"]
        codec => json
        decorate_events => true
    }
}

6. Set up security for Elasticsearch

Basic security must be set to use all the features of Elasticsearch.

Follow these minimal security and basic security docs to complete the security settings and transfer the issued certificate to ./elasticsearch/config.

If you don't need security, turn off the security at elasticsearch/config/elasticsearch.yml.

7. Setup security for fleet server

After set up the basic security, you should create certificates for fleet server.

Follow this self-managed setup guide to set up server and create the certificates and transfer it to ./fleet-server.

It's not essential. If you don't want to use it, you can remove the Fleet server setting.

Run

You can just use shell script monitor_service.sh to run the monitoring system easily.

sh monitor_service.sh start
sh monitor_service.sh stop
sh monitor_service.sh restart
sh monitor_service.sh status
sh monitor_service.sh logs {service name}
sh monitor_service.sh update {service name}

swarm-monitoring-stack's People

Contributors

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