Code Monkey home page Code Monkey logo

cluster-monitoring-seed's Introduction

Cluster monitoring

Sample seed for cluster's monitoring.

Cluster is built basing on:

  • Log-stash: log aggregator
  • Elastic-search: search engine, load-balancer
  • Kibana: analytics and visualization
  • Docker: virtualization
  • Ansible: deployment & provisioning

Note:

Monitoring is prepared to watch over sample cluster-seed.

Infrastructure

Basic cluster monitoring configuration looks like following:

    ┌──────────────────────────┐           ┌────────────────────────────┐
    │ monitoring (node 1)      │           │ monitoring   (node 2)      │
    └───────────────┬──────────┘           └──────┬─────────────────────┘
                    │                             │
                    │                             │
                    └────────────┐   ┌────────────┘
                                 │   │
                                 │   │
                          ┌──────┴───┴──────┐
                          │ LB (node 1,2)   │
                          └────────┬────────┘
                                   │
                                   │
                                in-data

Each node is composed of running monitoring services and LB.

Each service is run on separate Docker container.

Provisioning

Install all depedendencies and prepare monitoring.

cd ansible
ansible-playbook -i {{env}} provisioning/site.yml

Deployment

Deploy configuration and start monitoring services.

cd ansible
ansible-playbook -i {{env}} deployment/site.yml

Local development

To speed up local development & testing Vagrant configuration is provided.

In order to star virtual cluster locally just hit:

vagrant up

After that two nodes will be started:

  • monitoring-node1: 10.10.2.30
  • monitoring-node2: 10.10.2.31

Don't forget to provide your key later on while performing any activities on cluster, for instance:

cd ansible
# ansible with provided private key
ansible-playbook -i {{env}} provisioning/site.yml  --private-key=~/.vagrant.d/insecure_private_key

Checking cluster state

After deployment running services on cluster can be checked using following command:

ansible all -i {{env}} -a "docker ps "

For local cluster on Vagrant it looks like following:

ansible all -i local -a "docker ps" --sudo --private-key=~/.vagrant.d/insecure_private_key

Sample output of "docker ps" for local cluster:

TODO add traces here

Ansible - common commands

Some samples of handy commands to be familiar with.

  1. Ping
ansible all -i {{env}} -m ping
  1. Run a command on all servers
ansible all -i {{env}} -a "whoami"
ansible all -i {{env}} -a "uptime"
ansible all -i {{env}} -a "date"
ansible all -i {{env}} -a "cat /etc/issue"
ansible all -i {{env}} -a "docker ps"
  1. Show memory, cpu and other config options on all servers
ansible all -i {{env}} -m setup
ansible all -i {{env}} -m setup -a "filter=ansible_*_mb"
ansible all -i {{env}} -m setup -a "filter=ansible_processor*"
ansible all -i {{env}} -m setup -a "filter=ansible_all_ipv4_addresses"
ansible all -i {{env}} -m setup -a "filter=ansible_bios_*"
  1. Run playbook
ansible-playbook -i {{env}} deployment/site.yml --ask-sudo-pass
ansible-playbook -i {{env}} deployment/site.yml --tags logs --ask-sudo-pass
  1. Dry-run, i.e. only check and report what changes should be made without actually executing them
ansible-playbook -i {{env}} deployment/site.yml --tags "logs" --ask-sudo-pass --check
ansible-playbook -i {{env}} deployment/site.yml --tags "logs" --ask-sudo-pass --check --diff

cluster-monitoring-seed's People

Contributors

m-wrona avatar

Stargazers

 avatar

Watchers

 avatar  avatar

cluster-monitoring-seed's Issues

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.