项目作者: matthanley

项目描述 :
MariaDB Galera health check script for HAProxy
高级语言: Python
项目地址: git://github.com/matthanley/haproxy-galera.git
创建时间: 2019-12-31T08:21:45Z
项目社区:https://github.com/matthanley/haproxy-galera

开源协议:MIT License

下载


haproxy-galera

MariaDB Galera health check script for HAProxy

Installation

Copy main.py to /usr/local/sbin/haproxy-galera and chmod +x.

Dependencies

Requires python-mysqldb, and python-requests installed.

Systemd

Copy the included systemd unit file haproxy-galera.service to /etc/systemd/system/.

Usage

MariaDB Setup

Create a local user to connect and check status:

  1. CREATE USER 'haproxy'@'localhost';

HAProxy Setup

  1. listen MYSQL
  2. bind 0.0.0.0:3306
  3. mode tcp
  4. option tcplog
  5. option httpchk
  6. balance leastconn
  7. default-server port 3305 inter 2s downinter 5s rise 3 fall 1 maxconn 128 maxqueue 128 weight 100 slowstart 60s
  8. server db1 192.168.22.141:3306 check
  9. server db2 192.168.22.142:3306 check backup
  10. server db3 192.168.22.143:3306 check backup