GithubHelp home page GithubHelp logo

pmacontrol / haproxy_galera_check Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mtds/haproxy_galera_check

0.0 0.0 0.0 29 KB

Shell script to check and report the status of a Galera node to HAproxy

License: Apache License 2.0

Shell 100.00%

haproxy_galera_check's Introduction

clusterchk: Galera cluster status check script with HAproxy

This repo contains a shell script which checks the status of a MySQL instance part of a Galera cluster and reports an HTTP message to HAproxy if the node is in sync with the rest of the cluster or not.

The script implements the following algorithm:

Galera Health Flowchart

The main idea came from the following article: https://severalnines.com/resources/tutorials/mysql-load-balancing-haproxy-tutorial

Limitations

At the moment the script is designed to be executed only on Debian/Ubuntu Linux distributions, since it is relying on the sys-maint user defined under /etc/mysql/debian.cnf in order to connect to the MySQL instance.

HAproxy

The main point of using HAproxy is to balance TCP connections between application servers and the Galera cluster, not to mention the possibility of logically separate the database servers from the DMZ network.

(Reference: http://galeracluster.com/documentation-webpages/haproxy.html)

HAproxy is a generic load balancer and proxy server for TCP and HTTP based applications, so it does not concern itself with the status of the servers on the other side: either they are available or it will select other destinations, based on different routing policies ( Round Robin, Least Connected, Source Tracking, etc.).

The problem with Galera is that the MySQL server which HAproxy has selected can be up&running but it could be that the internal status is not Synced with the rest of the cluster.

An example on how to configure HAproxy to run the shell script is available under the haproxy subdirectory.

Running clusterchk using SystemD

As a quick test, the script can be executed also directly on the command line but in production the main idea is to use the SystemD units available under the systemd subdirectory.

haproxy_galera_check's People

Contributors

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