# Mysqlchk in container

**URL:** <https://forums.percona.com/t/mysqlchk-in-container/9687>\
**Category:** Percona XtraDB Cluster 8.x\
**Created:** [March 16, 2021, 6:37pm UTC](https://forums.percona.com/t/mysqlchk-in-container/9687 "2021-03-16T18:37:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjengel11](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@jjengel11](https://forums.percona.com/u/jjengel11)\
**Post date:** [March 16, 2021, 6:37pm UTC](https://forums.percona.com/t/mysqlchk-in-container/9687/1 "2021-03-16T18:37:33Z")

</div>

I am running percona-xtradb 8.0.21 in a docker container. I am trying to configure haproxy to load balance but can’t quite get it. I’m following this

[https://www.percona.com/doc/percona-xtradb-cluster/LATEST/howtos/haproxy.html](https://www.percona.com/doc/percona-xtradb-cluster/LATEST/howtos/haproxy.html)

and this

> **[Setting up PXC reference architecture with HAProxy](https://www.percona.com/doc/percona-xtradb-cluster/5.6/howtos/virt_sandbox.html)**
>
> Setting up PXC reference architecture with HAProxy

I can run the clustercheck script as such

```auto
docker exec -it percona-xtradb clustercheck clusteradmin ****

```

and get the 200 OK (Percona XtraDB Cluster Node is synced.) response

but can’t quite figure it out the mysqlchk part. I have dropped the mysqlchk file in /etc/xinetd.d inside the container and restarted it, however I do not see 9200 listening on the container host. I do see 3306 and can make remote mysql connections into mysql running in the container.

I do not see any xinetd service unit.

Should I pull mysqlchk and clustercheck out of the container and run on the container host?

Maybe proxysql is the way to go. Just figured it would be nice to know how others have done it with haproxy.

Thanks

---

<div class="post-metadata">

**Author:** ![jjengel11](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@jjengel11](https://forums.percona.com/u/jjengel11)\
**Post date:** [March 18, 2021, 11:19am UTC](https://forums.percona.com/t/mysqlchk-in-container/9687/2 "2021-03-18T11:19:47Z")

</div>

I was able to get this working. I moved the mysqlchk from the container and run it on the localhost. I modifed it some to look like this

```auto
service mysqlchk
{
  disable = no
  flags = REUSE
  socket_type = stream
  type = UNLISTED
  port = 9200
  wait = no
  user = root
  server = /usr/bin/docker
  log_on_failure += USERID
  only_from = <haproxy IP>
  per_source = UNLIMITED
  server_args = exec percona-xtradb /usr/bin/clustercheck <user> <pass> 0 /dev/null 0
}

```

I had to touch this file as root

```auto
touch ~/.docker/config.json

```

b/c without it I would get this as the first line of output when running clustercheck thru docker exec as root

```auto
WARNING: Error loading config file: .dockerconfig: $HOME is not defined

```

And haproxy would show db as down b/c it expects to see the HTTP/1.1 200 OK line first
