MariaDB MaxScale Installation Guide
Follow step-by-step instructions to install MariaDB MaxScale on major Linux distributions. This guide covers repository configuration and package installation.
Quickstart Guide: MariaDB MaxScale
MariaDB MaxScale is an advanced, open-source database proxy that provides intelligent routing, load balancing, high availability, and security features for your MariaDB and MySQL deployments. It acts as an intermediary, forwarding database statements to one or more backend database servers based on configured rules and server roles, all transparently to your applications.
Key concepts
To understand MaxScale, familiarize yourself with these core components:
Servers: These are your backend MariaDB or MySQL instances that MaxScale will manage traffic to.
Monitors: Plugins that observe the health and state of your backend servers (e.g., primary, replica, down).
Routers: Plugins that determine how client queries are directed to backend servers (e.g., readwritesplit router for directing writes to a primary and reads to replicas).
Installation
MariaDB MaxScale is typically installed from the official MariaDB repositories.
Add MariaDB Repository:
Use the MariaDB Repository Configuration Tool (search "MariaDB Repository Generator") to get specific instructions for your OS and MaxScale version.
Installation for Debian/Ubuntu:
Installation for RHEL/Rocky Linux/Alma Linux:
Basic configuration
MaxScale's configuration is primarily done in its main configuration file in /etc/maxscale.cnf.
Define Servers:
Add a section for each of your backend MariaDB servers.
Define a Monitor:
This section tells MaxScale how to monitor your backend servers' health and roles and groups them into a cluster of servers.
Complete configuration
Your /etc/maxscale.cnf should now look like this:
Start and enable MaxScale
After configuring maxscale.cnf, start and enable the MaxScale service.
Basic usage and verification
Once MaxScale is running, configure your applications to connect to MaxScale's listener port instead of directly to a MariaDB server.
Example (Connect with mariadb client from the MaxScale server):
Verify Read-Write Split (if configured):
Further Resources: