Step 5: Start and Configure MariaDB MaxScale

Overview

This page details step 5 of the 6-step procedure "Deploy Xpand Performance Topology".

This step starts and configures MaxScale.

Interactive commands are detailed. Alternatively, the described operations can be performed using automation.

Several of the actions on this page use MaxCtrl. For additional information about MaxCtrl, see "MaxCtrl (MaxScale 2.5)". Alternative configuration options are available.

Replace Default Configuration File

The default configuration file for MaxScale contains an example configuration that is not needed for this topology. Replace the /etc/maxscale.cnf file on the MaxScale node with the following configuration:

[maxscale]
threads          = auto
admin_host       = 0.0.0.0
admin_secure_gui = false

For additional information, see "Global Parameters (MaxScale 2.5)" and "Module Parameters (MaxScale 2.5)".

Start the MaxScale Service

The MaxScale service must be started.

This action is performed on the MaxScale node.

Use the restart command to ensure that MaxScale picks up the new configuration.

To start the MaxScale process:

$ sudo systemctl restart maxscale

Configure Server Objects

Use the maxctrl create server to create a server module for each Xpand node.

This action is performed on the MaxScale node.

To configure MaxScale to recognize each server:

$ maxctrl create server xpand1 192.0.2.1
$ maxctrl create server xpand2 192.0.2.2
$ maxctrl create server xpand3 192.0.2.3

In this example:

  • xpand1, xpand2, and xpand3 are server names.

  • 192.0.2.1, 192.0.2.2, and 192.0.2.3 are the IP addresses for those servers.

For additional information, see "Module Parameters (MaxScale 2.5)".

Configure Xpand Monitor

Use the maxctrl create monitor command to create a monitor service for Xpand.

This action is performed on the MaxScale node.

To configure MaxScale to start the monitor:

$ maxctrl create monitor xpand_monitor xpandmon \
   --servers xpand1 xpand2 xpand3 \
   --monitor-user=mxs \
   --monitor-password=mxs_user_passwd

In this example:

  • xpand_monitor is the name of the monitor.

  • xpandmon is the module.

  • xpand1, xpand2, and xpand3 are names of the configured server objects.

  • mxs is our database user account for MaxScale, specified with the --monitor-user option.

  • mxs_user_passwd is the password for our database user account, specified with the --monitor-password option.

For additional information, see "Module Parameters (MaxScale 2.5)".

Configure Read/Write Split Router

Use the maxctrl create service command to create a Read/Write Split routing service for Xpand.

This action is performed on the MaxScale node.

MaxScale Read/Write Split Router is used to load balance traffic.

To configure MaxScale to start the router:

$ maxctrl create service xpand_service readwritesplit \
   user=mxs \
   password=mxs_user_passwd \
   --servers xpand1 xpand2 xpand3

In this example:

  • xpand_service is the name of the new service.

  • readwritesplit is the router.

  • mxs is our database user account for MaxScale, specified as a key=value pair.

  • mxs_user_passwd is the password for our database user account, specified as a key=value pair.

  • xpand1, xpand2, and xpand3 are names of the configured server objects, specified with the --servers option.

For additional information, see "Module Parameters (MaxScale 2.5)" and "Read/Write Split Router".

Configure the Router's Listener

Use the maxscale create listener command to create a listener for the router.

This action is performed on the MaxScale node.

These instructions reference TCP port 3306. You may alternatively use a different TCP port. The TCP port used must not be bound by any other listener.

To configure MaxScale to start the router's listener:

$ maxctrl create listener xpand_service xpand_listener 3306 \
   --protocol=MariaDBClient

In this example:

  • xpand_service is the service.

  • xpand_listener is the name of the new listener.

  • 3306 is the TCP port.

  • MariaDBClient is the protocol, specified with the --protocol option.

Next Step

Navigation in the procedure "Deploy Xpand Performance Topology":

  • This page was step 5 of 6.