Skip to content

ProxySQL Plugin

Overview

ProxySQL is a high-performance MySQL proxy that provides connection pooling, read-write splitting, and query routing. StarkOne manages ProxySQL as a plugin.

Plugin ID: proxysql

Service Control

GET /api/proxysql/status
POST /api/proxysql/install
POST /api/proxysql/remove
POST /api/proxysql/start
POST /api/proxysql/stop
POST /api/proxysql/restart

Backends (MySQL Servers)

GET /api/proxysql/backends
POST /api/proxysql/backends
{
  "hostname": "10.0.0.1",
  "port": 3306,
  "hostgroup": 1,
  "weight": 100,
  "max_connections": 100
}
PUT /api/proxysql/backends
DELETE /api/proxysql/backends
POST /api/proxysql/backends/reset
POST /api/proxysql/backends/max-connections
{ "max_connections": 200 }

Read-Write Split

POST /api/proxysql/read-write-split
{
  "write_hostgroup": 0,
  "read_hostgroup": 1,
  "masters": ["10.0.0.1"],
  "replicas": ["10.0.0.2", "10.0.0.3"]
}

Query Rules

GET /api/proxysql/query-rules

Users

POST /api/proxysql/users
{
  "username": "app_user",
  "password": "secret",
  "default_hostgroup": 0
}

Monitor User

POST /api/proxysql/monitor-user
{ "username": "monitor", "password": "secret" }

Statistics

GET /api/proxysql/stats
POST /api/proxysql/reset-stats

Admin Password

POST /api/proxysql/admin-password
{ "password": "new_admin_pass" }

Keepalived (Virtual IP for HA)

When ProxySQL is used in HA mode with Keepalived for virtual IP failover:

GET /api/proxysql/keepalived/status
POST /api/proxysql/keepalived/setup
{
  "virtual_ip": "10.0.0.100",
  "interface": "eth0",
  "priority": 100
}
POST /api/proxysql/keepalived/disable