Auto-Clustering

MariaDB / MySQL / Percona Auto-Clustering

Auto-clustering provides an out-of-the-box way to create highly available MariaDB, MySQL, and Percona database clusters. The platform automates replication setup, node discovery, load balancing, failover handling, and scaling through the topology wizard.

MariaDB MySQL Percona auto-clustering scheme
Auto-clustering architecture for MariaDB, MySQL, and Percona.

Auto-Clustering Benefits

High availabilityPreconfigured Primary-Secondary, Primary-Primary, Galera, and XtraDB replication options are available according to the database type.
Scalability and autodiscoveryNew nodes added during horizontal scaling are connected automatically with the required adjustments.
Efficient load balancingTwo ProxySQL nodes are supplied by default for load balancing and automatic read/write splitting.
Automated failover handlingUnavailable or high-latency database nodes are excluded automatically and re-added once connectivity returns.

Enable Automatic Clustering

Click New Environment and choose MariaDB, MySQL, or Percona. Enable Auto-Clustering to display the supported replication schemes.

Create a new database environment
Choose MariaDB, MySQL, or Percona in the topology wizard.
DatabaseAvailable Replication Schemes
MariaDBPrimary-Secondary, Primary-Primary, Galera
MySQLPrimary-Secondary, Primary-Primary
PerconaPrimary-Secondary, Primary-Primary, XtraDB

Auto-Clustering Options

Highly Available ProxySQL Load Balancer

Each auto-clustering solution includes two ProxySQL nodes by default. They can be excluded before installation, but not afterward.

Auto-clustering ProxySQL option
ProxySQL is enabled by default in front of the database cluster.

Database Cluster Access Credentials

The platform generates database credentials automatically. To override them, open Variables and define DB_USER and DB_PASS, then click Apply.

Database variables
Open the database Variables dialog.
Add database credentials variables
Define DB_USER and DB_PASS for custom cluster credentials.

Cluster Horizontal Scaling

For Primary-Secondary or Primary-Primary clusters, an additional node is created by cloning an existing secondary. After cloning, it catches up through binary-log replay.

Cluster Layer Isolation

Use SLB access to decide which cluster layers are exposed externally: all required layers or only the ProxySQL entry-point layer.

Database access through SLB
Configure external access for the database and proxy layers.
Database auto-cluster created
The cluster is ready after automatic installation.

Database Cluster Access Information

After successful installation, the platform emails access information for phpMyAdmin on the primary node, the cluster entry point, and the ProxySQL web panel.

Access phpMyAdmin
Use the emailed credentials to access phpMyAdmin on the primary node.

The ProxySQL entry-point hostname follows:

proxy.${envName}.${platformDomain}
ProxySQL database replication
Applications connect through the ProxySQL entry-point layer.
Custom users created after installation: add them to the mysql_users table on every ProxySQL node or they will not be able to authenticate through the proxy layer.
MYSQL_PWD=admin mysql -h 127.0.0.1 -P6032 -uadmin -e "INSERT INTO mysql_users (username,password,default_hostgroup) VALUES ('<username>', '<password>', 2);"
MYSQL_PWD=admin mysql -h 127.0.0.1 -P6032 -uadmin -e "LOAD MYSQL USERS TO RUNTIME; SAVE MYSQL USERS TO DISK;"
ProxySQL web panel
Review ProxySQL and backend database statistics in the web panel.

What Replication Type to Choose?

Primary-Secondary

Primary-Secondary uses one write node and one or more read replicas. It offers low write latency and strong read scaling. The source documentation notes that it does not provide automatic failover when the primary fails.

  • High performance for read requests
  • Backups can run on secondaries without loading the primary
  • Analytical queries can run on secondaries
Primary Secondary cluster scheme
Primary-Secondary replication topology.

Primary-Primary

Primary-Primary asynchronous replication uses two primary nodes simultaneously. It balances write load and simplifies recovery when one primary fails. New secondary nodes are distributed between the two primaries when the cluster is scaled.

Primary Primary cluster scheme
Primary-Primary replication topology.

MariaDB Galera and Percona XtraDB

Galera and XtraDB provide synchronous multi-primary replication. Applications can send reads and writes to any node, node changes are automated, and the synchronous model minimizes replication delay and inconsistent data copies.

Galera and XtraDB cluster scheme
Galera and XtraDB synchronous multi-primary topology.

Expected Result

A MariaDB, MySQL, or Percona cluster is created with the selected replication topology, optional SLB exposure, generated or custom credentials, and ProxySQL load balancing when retained. Applications connect through the cluster entry-point hostname sent by the platform.

Important Notes

  • ProxySQL is enabled by default and can only be excluded before installation.
  • Supported replication modes vary by database type.
  • Custom credentials use DB_USER and DB_PASS.
  • SLB access controls which cluster layers are externally exposed.
  • Users created after installation must also be added to ProxySQL for proxy-layer authentication.