Step 8: Start and Configure MariaDB MaxScale

Overview

This page details step 8 of the 9-step procedure "Deploy Xpand Storage Engine Topology".

This step starts and configures MariaDB MaxScale 2.5.

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

Replace the 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 Xpand Server Objects

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

This action is performed on the MaxScale node.

$ maxctrl create server xpand1 192.0.2.101
$ maxctrl create server xpand2 192.0.2.102
$ maxctrl create server xpand3 192.0.2.103

In this example,

  • xpand1, xpand2, and xpand3 are the server names for the Xpand nodes.

  • 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 ES Server Objects

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

This action is performed on the MaxScale node.

Configure server objects for each Enterprise Server node:

$ maxctrl create server es1 192.0.2.111
$ maxctrl create server es2 192.0.2.112
$ maxctrl create server es3 192.0.2.113

In this example,

  • es1, es2, and es3 are the server names for the Enterprise Server nodes.

  • 192.0.2.10, 192.0.2.11, and 192.0.2.12 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 \
   --monitor-user=mxs \
   --monitor-password=mxs_user_passwd \
   --servers xpand1 xpand2 xpand3

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 MariaDB Enterprise Server Monitor

Use the maxctrl create monitor command to create a monitor service for the Enterprise Server nodes.

This action is performed on the MaxScale node.

To configure MaxScale to start the monitor:

$ maxctrl create monitor es_monitor mariadbmon \
   --monitor-user=mxs \
   --monitor-password=mxs_user_passwd \
   --servers es1 es2 es3

In this example:

  • es_monitor is the name of the monitor.

  • mariadbmon is the module.

  • es1, es2, and es3 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 Router for Xpand

Use the maxctrl create service command to create a Read Connection routing service for Xpand nodes to handle administrative tasks.

This action is performed on the MaxScale node.

MaxScale Read Connection Router is used to route connections to an available Xpand node.

To configure MaxScale to start the router:

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

In this example:

  • xpand_service is the name of the new service.

  • readconnroute 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 Router for Enterprise Server

Use the maxctrl create service command to create a Read/Write Split routing service for application connections and queries to the Enterprise Server nodes.

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 es_service readwritesplit \
   user=mxs \
   password=mxs_user_passwd \
   --servers es1 es2 es3

In this example:

  • es_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.

  • es1, es2, and es3 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 a Listener for Xpand

Use the maxscale create listener command to create a listener for the administrative Xpand routing service.

This action is performed on the MaxScale node.

These instructions reference TCP port 5001. 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 5001 \
   --protocol=MariaDBClient

In this example:

  • xpand_service is the service.

  • xpand_listener is the name of the new listener.

  • 5001 is the TCP port.

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

Configure a Listener for Enterprise Server

Use the maxscale create listener command to create a listener for the Enterprise Server routing service.

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 es_service es_listener 3306 \
   --protocol=MariaDBClient

In this example:

  • es_service is the service.

  • es_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 Storage Engine Topology":

  • This page was step 8 of 9.