olafz / percona-clustercheck

Script to make a proxy (ie HAProxy) capable of monitoring Percona XtraDB Cluster nodes properly. The clustercheck script is distributed under the BSD license.
BSD 3-Clause "New" or "Revised" License
173 stars 108 forks source link

Mismatch between clustercheck and xinetd response #7

Open OliverKellyATech opened 10 years ago

OliverKellyATech commented 10 years ago

Hi guys,

Quick question; I am getting a mismatch between the clustercheck response (via cli) and the response returned via the mysqlchk xinetd request:

root@host:~# /usr/local/bin/clustercheck 
HTTP/1.1 200 OK
Content-Type: text/plain
Connection: close
Content-Length: 40

Percona XtraDB Cluster Node is synced.
root@host:~# curl -v http://localhost:9200/
* About to connect() to localhost port 9200 (#0)
*   Trying 127.0.0.1... connected
> GET / HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: localhost:9200
> Accept: */*
> 
< HTTP/1.1 503 Service Unavailable
< Content-Type: text/plain
< Connection: close
< Content-Length: 44
< 

/etc/xinetd.d/mysqlchk is configured to simply call server=/usr/local/bin/clustercheck, as per the install instructions.

Any ideas?

mike-sirs commented 9 years ago

show your /etc/xinetd.d/mysqlchk

vovans82 commented 8 years ago

This is happening for me too.

Lovecannon commented 8 years ago

For anyone else having this issue, I was able to fix it by changing the mysqlchk xinetd script to use the root user.

iboxtech commented 7 years ago

This is happening for me too. Anyone can slove it ?

sruslanas commented 7 years ago

I have moved to another utility that is doing exactly the same, but with less effort (written in go, no xinetd required) https://github.com/leoleovich/clusterhc

weeheavy commented 7 years ago

Same problem here, even with the Percona-provided clustercheck script which is based on this here. Attempts like changing the xinetd user and making sure execute permissions are set on the MySQL socket directory didn't help.

Edit: Fixed by not quoting the password in the xinetd definition (in server_args):

Fails:

[...]
server = /usr/bin/clustercheck
server_args = clustercheck "the-password"
[...]

Works:

[...]
server = /usr/bin/clustercheck
server_args = clustercheck the-password
[...]
metajiji commented 5 years ago

Related issue https://bugzilla.redhat.com/show_bug.cgi?id=459553

And for use credentials from .cnf file as workaround use the wrapper script /usr/bin/clustercheck.wrapper like:

#!/bin/sh
/usr/bin/clustercheck "" "" $@

And xinetd config should be:

server = /usr/bin/clustercheck.wrapper
server_args = 0 /dev/null 0 /etc/mysqlchk.cnf

Dont amend chmod +x /usr/bin/clustercheck.wrapper