Code Monkey home page Code Monkey logo

bonding-monitor's Introduction

bonding-monitor

Turns out you can use interface bonding on Mikrotik switches to load balance server traffic at wire speeds. But the switch is not able to monitor the servers, at least not at L4 or higher, so we want a monitoring solution that can disable the component port of a failed server.

Configuration

See config.example.toml for an example configuration.

The user account on the switch needs to belong to a group that has the api, read and write policies enabled. The switch needs to have a TLS certificate and the api-ssl service enabled.

Running with Docker

The main branch of this repository is automatically built and uploaded to Docker Hub with the tag richiefi/bonding-monitor:latest. You can either use that are the baseline for your own Dockerfile or mount a configuration file into the container.

Behavior

bonding-monitor checks reachability of each configured server in turn. If one or more local IPs were given on the command line, configured servers matching those IPs will be ignored (as monitoring the reachability of localhost is often less than useful).

If a server fails a health check twice in a row, its configured port on the switch will be disabled and the comment bonding-monitor health check fail set on the port.

If a server is healthy twice in a row, but the port on the switch is disabled due to a previous failure (as indicated by having the check fail comment), bonding-monitor will change its comment to bonding-monitor preparing to enable. Finally, if a server is healthy for four consecutive checks and the port comment remains bonding-monitor preparing to enable, the port will be enabled and the comment removed.

You can run the monitor on multiple servers simultaneously; for example, on all of the servers of the monitored cluster.

Known issues

There is a --debug/--no-debug flag but no debug output is currently available.

bonding-monitor's People

Contributors

markonen avatar

Watchers

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