Skip to content

Instantly share code, notes, and snippets.

@eRadical
Forked from sts/clustercheck.socket
Created September 12, 2017 09:44
Show Gist options
  • Save eRadical/8e3a6ddcdbbf9d21fa96caed28673d3e to your computer and use it in GitHub Desktop.
Save eRadical/8e3a6ddcdbbf9d21fa96caed28673d3e to your computer and use it in GitHub Desktop.
Percona XDB Clustercheck with SystemD
# /etc/systemd/system/clustercheck.socket
[Unit]
Description=MySQL Clustercheck Socket
[Socket]
ListenStream=9200
Accept=true
[Install]
WantedBy=sockets.target
# /etc/systemd/system/[email protected]
[Unit]
Description=MySQL Clustercheck
After=network.target
[Service]
User=nobody
ExecStart=-/usr/bin/clustercheck clustercheck AoWdTTItrUqNo9aNY
StandardInput=socket
# /etc/rsyslog.d/mysql_clustercheck.conf
#
# systemd log fixup - No, we don't want to log mysql clustercheck systemd
# messages everytime haproxy connects (every 500ms per LB in our case)
if $programname == 'systemd' and $msg contains 'Starting MySQL Clustercheck' then stop
if $programname == 'systemd' and $msg contains 'Started MySQL Clustercheck' then stop

Systemd Clustercheck

Clustercheck is a script to make a proxy (ie. haproxy) capable of monitoring Percona XtraDB Cluster nodes properly. This is a config to run clustercheck/mysqlchk from systemd instead of xinetd.

INSTALL

cp clustercheck.socket /etc/systemd/system
cp [email protected] /etc/systemd/system
systemctl enable clustercheck.socket
systemctl start clustercheck.socket
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment