-
Notifications
You must be signed in to change notification settings - Fork 2
Test Ecosystem
Value Proposition Certify AI interactions within a secure, isolated integration environment. Simulate production-scale deployments, verify security boundaries, and ensure your autonomous workflows are reliable before reaching production. Read the full value proposition
This guide provides the blueprint to seamlessly deploy, manage, and troubleshoot a fully integrated, production-grade test ecosystem featuring InnoDB Cluster, MySQL Router, and ProxySQL. Empower your teams to rigorously validate AI agents in a safe, isolated environment, ensuring stability and performance before entering production. The stack is pre-configured with out-of-the-box Datadog integrations, running alongside Prometheus and Grafana, to provide seamless, comprehensive metrics observability and APM.
Tip
Looking for end-user templates? This page documents the heavy internal E2E testing infrastructure. If you just want a clean, user-friendly Docker template for your own projects, check out the examples/ directory in the main repository!
Ensure validation safety and accelerate your testing lifecycle with our fully automated teardown and deployment process. The scripts bootstrap Group Replication idempotently, allowing you to safely simulate production-grade environments and validate AI workflows in minutes.
cd test-server/infrastructure
node scripts/recreate-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 the core database architecture alongside a comprehensive observability stack 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, 6449 │ │ Admin: 6032 │ │ Port: 6379 │ │
│ │ REST API: 8443 │ │ Data: 6033 │ │ │ │
│ └─────────────────────────┴────┴──────────────┘ └──────────────┘ │
│ │
│ ┌──────────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Prometheus │ │ Grafana │ │ Adminer │ │
│ │ Port: 9090 │ │ Port: 3001 │ │ Port: 8081 │ │
│ └──────────────────┘ └──────────────┘ └──────────────┘ │
│ │
│ ┌──────────────────┐ ┌──────────────┐ │
│ │ Loki │ │ Promtail │ │
│ │ Port: 3100 │ │ (Internal) │ │
│ └──────────────────┘ └──────────────┘ │
│ │
│ ┌──────────────────┐ ┌──────────────┐ │
│ │ Dozzle │ │ Datadog │ │
│ │ Port: 8080 │ │ Port: 8126 │ │
│ └──────────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘
Rapidly restore a pristine state. You may need to re-seed the testdb for E2E validation. This avoids 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, you do not need to run manual scripts. The cluster-healer Docker sidecar constantly monitors the cluster topology.
If it detects a complete outage, it automatically executes dba.rebootClusterFromCompleteOutage(). To monitor recovery events:
docker logs -f cluster-healerNote
The local test cluster uses non-standard ports (3307-3309). This differs from the default 3306 shown in standard configuration examples. This avoids conflicts with local installations.
| Property | Value |
|---|---|
| Primary (R/W) | tcp://localhost:3307 |
| Read Replicas (R/O) |
tcp://localhost:3308, tcp://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 (Classic), 6449 (X-Protocol) (→ SECONDARY) |
| Property | URL |
|---|---|
| Datadog | Internal to Docker Network (8126). Use the included pup script to sync JSON dashboards like AI Efficiency and Token & Tool Metrics (including the MySQL-MCP Audit Log widget). |
| Prometheus | http://localhost:9090 |
| Loki | http://localhost:3100 |
| Promtail | (network-internal only) |
| Grafana |
http://localhost:3001 (admin/admin) |
| Dozzle (Logs) | http://localhost:8080 |
| Adminer (DB UI) |
http://localhost:8081 (Server: mysql-node1 (uses internal Docker network port 3306), User: root, Pass: root) |
| ProxySQL Admin | tcp://localhost:6032 |
| ProxySQL Data | tcp://localhost:6033 |
| Redis | tcp://localhost:6379 |
While this ecosystem can be deployed on any standard Docker host, Windows users running native docker-ce inside WSL2 Ubuntu (without Docker Desktop) may encounter a known WSL2 idle timeout behavior. The distro may terminate without active Windows-side client sessions, stopping all containers.
Windows-Specific Workarounds
A Windows Scheduled Task (WSL-KeepAlive) runs at user logon. It executes scripts/wsl-keepalive.vbs. This script 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 indicates a WSL termination issue. -
Identify the root cause: Run
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: Certain host kernel environments 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
Value Proposition Enforce strict execution boundaries and maximize LLM context efficiency for secure, autonomous database interactions. Read the full value proposition
- Installation
- Configuration
- Architecture
- HTTP Transport
- Tool Filtering
- Code Mode
- Tools
- Prompts
- Resources
- Observability & Telemetry