Giter VIP home page Giter VIP logo

galera-ha's Introduction

galera-ha

Small Thin server monitoring Galera cluster members state - useful for HAProxy HTTP check

This small (better, it's Thin') Ruby server written to work with HAProxy and ensure High Availability of Galera cluster server (balanced) behind HAProxy.

Why?

Layer 4 check on HAProxy is not enough. When server comes up and is not provisioned (preparing for SST/IST after outage or when joining the cluster i.e.) L4 (TCP port) is already listening, but machine is incapable of serving data. At this time, HAProxy check is "green", but all commands will fail with some cryptic errors like "Command not found".

##How? We will run HTTP server (on port 3336 by default) and we will check if our node is already in Synced state, thus have all data in sync and will process our requests, this information is stored in status variable called 'wsrep_local_state_comment', if it's value is 'Synced' we will return HTTP/1.1 200, otherwise HTTP/1.1 504. Now we can setup HAProxy to make Layer 7 (HTTP) check on Galera nodes, so haproxy.cfg server lines will look somehow like this :

  http-check expect status 200
  option httpchk GET /galera-state

  server node1 192.168.110.3:3306  check port 3336 inter 15s fastinter 2s downinter 1s rise 5 fall 3
  server node2 192.168.110.4:3306  backup check port 3336 inter 15s fastinter 2s downinter 1s rise 5 fall 3
  server node3 192.168.110.8:3306  backup check port 3336 inter 15s fastinter 2s downinter 1s rise 5 fall 3

##Installation You can install it with Makefile :

make
make install
make start

But you will propably want to edit /etc/galera-ha.yaml before make start, unless you're using monitoring:password credentials to monitor you MySQL machines ;)

galera-ha's People

Contributors

tomashejatko avatar

Watchers

James Cloos 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.