Giter VIP home page Giter VIP logo

mysql_gr_routing_check's Introduction

mysql_gr_routing_check

MySQL Group Replication Routing/Heath Check script

This script can be used with HA Proxy for example.

You need to call it via xinetd, this is an example::

# default: on
# description: check to see if the node is a viable routing candidate
service mysql_gr_routing_check_write
{
    disable = no
    flags = REUSE
    socket_type = stream
    port = 6446
    wait = no
    user = mysql
    server = /usr/local/bin/mysql_gr_routing_check.sh
    server_args = 100 write
    log_on_failure += USERID
    only_from = localhost 192.168.90.0/24
    per_source = UNLIMITED
}

The script can take two optional arguments:

  • amount of max transactions in queue to be processed by the Group Member (trx behind), default is 100
  • the role, READ or WRITE, default is WRITE

Usage example::

[root@mysql1 bin]# telnet 192.168.90.2 6446
Trying 192.168.90.2...
Connected to 192.168.90.2.
Escape character is '^]'.
HTTP/1.1 200 OK
Content-Type: text/plain
Connection: close
Content-Length: 40

Group Replication member is a viable routing candidate for write.
Connection closed by foreign host.


[root@mysql1 bin]# telnet 192.168.90.2 6447
Trying 192.168.90.2...
Connected to 192.168.90.2.
Escape character is '^]'.
HTTP/1.1 200 OK
Content-Type: text/plain
Connection: close
Content-Length: 40

Group Replication member is a viable routing candidate for read.
Connection closed by foreign host.

Don't forget that you need some addition to sys schema. These are not yet released in the default sys schema

To install the missing functions and views, please import addition_to_sys.sql:

mysql < addition_to_sys.sql 

mysql_gr_routing_check's People

Contributors

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