-
Notifications
You must be signed in to change notification settings - Fork 2
Test Ecosystem
Value Proposition Validate complex enterprise architectures within a comprehensive test ecosystem. Test scalable deployments, rigorously enforce secure isolation, and maintain robust operational oversight. Read the full value proposition.
This guide details how to deploy, manage, and troubleshoot the MySQL test ecosystem. Deploy an integrated topology. Combine InnoDB Cluster, MySQL Router, and ProxySQL. Ensure reliable AI agent behavior in rigorous scenarios.
Note
Note on Datadog: This environment natively includes datadog-unified alongside Prometheus and Grafana for comprehensive metrics observability and APM.
Accelerate your testing lifecycle. The teardown and deployment process is fully automated. The scripts bootstrap Group Replication idempotently. Get a production-grade environment in minutes.
cd test-server/infrastructure
node scripts/recreate-test-ecosystem.mjsThis master script will:
- Tear down the existing cluster and volumes (
docker compose down -v). - Start the fresh test containers (
docker compose up -d). - Automatically poll the nodes until they are healthy.
- Initialize the primary node (
mysql-node1) as the cluster creator. - Join
mysql-node2andmysql-node3to the cluster. - Output the final cluster topology.
This test ecosystem includes only the necessary components to validate the mysql-mcp server:
┌─────────────────────────────────────────────────────────────────────────────┐
│ Docker Network: infrastructure_default │
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ mysql-node1 │ │ mysql-node2 │ │ mysql-node3 │ │
│ │ PRIMARY │ │ SECONDARY │ │ SECONDARY │ │
│ │ Port: 3307 │ │ Port: 3308 │ │ Port: 3309 │ │
│ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘ │
│ │ │ │ │
│ └────────────┬────┴─────────────────┘ │
│ ▼ │
│ ┌──────────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ MySQL Router │ │ ProxySQL │ │ Redis │ │
│ │ RW: 6446 RO:6447 │ │ Admin: 6032 │ │ Port: 6379 │ │
│ │ REST API: 8443 │ │ Data: 6033 │ │ │ │
│ └──────────────────┴───────────┴──────────────┘ └──────────────┘ │
│ │
│ ┌──────────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Prometheus │ │ Grafana │ │ Adminer │ │
│ │ Port: 9090 │ │ Port: 3001 │ │ Port: 8081 │ │
│ └──────────────────┘ └──────────────┘ └──────────────┘ │
│ │
│ ┌──────────────────┐ ┌──────────────┐ │
│ │ Dozzle │ │ Datadog │ │
│ │ Port: 8080 │ │ Port: 8126 │ │
│ └──────────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘
Rapidly restore a pristine state. If you need to re-seed the testdb for E2E validation without the overhead of tearing down the entire cluster:
node scripts/reset-database.mjsIf containers are restarted and the cluster fails to auto-recover via SET PERSIST:
node scripts/reboot-cluster.mjsThis script executes dba.rebootClusterFromCompleteOutage().
Note
The local test cluster uses non-standard ports (3307-3309) compared to the default 3306 shown in standard configuration examples to avoid conflicts with local installations.
| Property | Value |
|---|---|
| Primary (R/W) | localhost:3307 |
| Read Replicas (R/O) |
localhost:3308, localhost:3309
|
| User | root |
| Password | root |
| Property | Value |
|---|---|
| REST API URL | https://localhost:8443 |
| REST API User | rest_api |
| REST API Password | router_api |
| RW Routing Port |
6446 (→ PRIMARY) |
| RO Routing Port |
6447 (→ SECONDARY) |
| Property | URL |
|---|---|
| Prometheus | http://localhost:9090 |
| Grafana |
http://localhost:3001 (admin/admin) |
| Dozzle (Logs) | http://localhost:8080 |
| Datadog | localhost:8126 |
| Adminer (DB UI) |
http://localhost:8081 (Server: mysql-node1 (uses internal Docker network port 3306), User: root, Pass: root) |
| ProxySQL Admin | localhost:6032 |
| ProxySQL Data | localhost:6033 |
| Redis | localhost:6379 |
This environment runs on native docker-ce inside WSL2 Ubuntu (no Docker Desktop). WSL2 has a known failure mode. The distro terminates without active Windows-side client sessions. This kills Docker and all containers.
A Windows Scheduled Task (WSL-KeepAlive) runs at user logon. It executes scripts/wsl-keepalive.vbs, which launches wsl.exe -d <Distro-Name> --exec sleep infinity with a hidden window. This holds the distro alive indefinitely.
If containers are cycling (green → red → green repeatedly):
-
Check if WSL is rebooting:
wsl bash -c "journalctl --list-boots"— multiple short-lived boots = WSL termination issue. -
Check for the smoking gun:
wsl bash -c "dmesg | grep InitTerminateInstanceInternal"— this message means WSL sentsystemctl poweroffto the distro. -
Check the keepalive task:
Get-ScheduledTask -TaskName 'WSL-KeepAlive' | Select State— must beRunning. -
Check Docker daemon:
wsl bash -c "systemctl status docker"— must beactive (running). -
Check iptables backend: Modern kernel versions require
iptables-nft. If Docker fails to start, check/etc/docker/daemon.jsonandupdate-alternatives --display iptables.
| File | Purpose |
|---|---|
%USERPROFILE%\.wslconfig |
WSL2 VM config: memory, swap, vmIdleTimeout=-1
|
/etc/docker/daemon.json |
Docker storage driver, log rotation |
/etc/systemd/system/wsl-keepalive.service |
Backup in-distro keepalive (defense-in-depth) |
scripts/wsl-keepalive.vbs |
Hidden launcher for the Windows Scheduled Task |
- MySQL Router - Connect and query through MySQL Router
- ProxySQL - ProxySQL integration
- MySQL Shell - Run MySQL Shell scripts
Unlock autonomous database orchestration with an enterprise-grade MySQL MCP server. Featuring blazing-fast sandboxed Code Mode, uncompromising schema enforcement, and seamless ecosystem integrations to power secure, intelligent AI workflows.
- Installation
- Configuration
- Architecture
- HTTP Transport
- Tool Filtering
- Code Mode
- Tools
- Prompts
- Resources
- Observability & Telemetry