https://github.com/lefred/mysql_gr_routing_check
MySQL Group Replication Routing/Heath Check script
https://github.com/lefred/mysql_gr_routing_check
Last synced: 4 months ago
JSON representation
MySQL Group Replication Routing/Heath Check script
- Host: GitHub
- URL: https://github.com/lefred/mysql_gr_routing_check
- Owner: lefred
- License: gpl-3.0
- Created: 2016-08-20T22:08:02.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2018-10-12T11:38:37.000Z (almost 8 years ago)
- Last Synced: 2025-10-05T00:51:37.923Z (9 months ago)
- Language: Shell
- Size: 14.6 KB
- Stars: 44
- Watchers: 6
- Forks: 43
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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