Code Monkey home page Code Monkey logo

monitor's Introduction

Docker Swarm - Containers Health Monitor Production Deployment

License Commit Releases Contributors

Repository with configuration files required for Containers Health Monitor Production Deployment using Docker Swarm.

Main Features:

  • Simplified and automated startup through scripts.

Prerequisites

  1. Linux (Ubuntu 16.04+ recommended)
  2. Docker Engine 18.06.0+
  3. Docker Compose 1.22.0+
  4. Make sure that Swarm is enabled by typing docker system info, and looking for a message Swarm: active (you might have to scroll up a little).
    • If Swarm isn’t running, simply type docker swarm init at a shell prompt to set it up.

1. Health monitor services stack

1.1 Set the environment variables

To ensure flexibility, the health monitor services receive some parameters through environment variables, e.g. SMTP configurations, credentials (username and password), etc.

First, create the configuration file based on the .env.monitor.example file:

$ cp .env.monitor.example .env.monitor

After making the settings, execute the command to assign the values defined in the environment variables that are in the settings file:

$ set -a && source .env.monitor && set +a

1.1.1 Authorization/Authentication Setup

Variables to define the administrator user's credentials the first time the Grafana is instantiated.

Variable Description Example
ADMIN_USERNAME Username of the default admin user created automatically at the first time the Grafana is instantiated. admin
ADMIN_PASSWORD Password of the default admin user created automatically at the first time the Grafana is instantiated. admin

1.1.2 External Services Ports

Variable Description Example
GF_PORT Port used by the Grafana service to listen for HTTP request. 3000

1.1.3 SMTP Setup

Variable Description Example
GF_SMTP_ENABLED Enable SMTP server settings. false
GF_SMTP_HOST Host where the SMTP server is allocated. smtp.gmail.com:465
GF_SMTP_USER Registered email on the SMTP server. It will be used to send emals when an alarm is detected. [email protected]
GF_SMTP_PASSWORD Password for the email registered on the SMTP server. secret

1.1.4 Storage Data

Variable Description Example
DATA_RETENTION Time the data remained stored in database. 15d - corresponds to 15 days

1.2 Building and Deploying the containers

Start services stack

$ docker stack deploy -c docker-monitor-stack.yml <stack_name>

Stop services stack

$ docker stack rm <stack_name>

monitor's People

Contributors

lucas-barbosa-oliveira avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

luanavnn-ctrl

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.