Basic Administration with MariaDB Xpand

Overview

This page outlines some frequently used utilities and tools available within Xpand.

Load Balancing Xpand

Xpand requires an external TCP load balancer to evenly distribute load across the cluster.

MariaDB recommends using MariaDB MaxScale with Xpand Monitor (xpandmon) for load balancing. For information about how to deploy MaxScale with Xpand, see "Deploy Xpand Performance Topology".

HAProxy is an alternative load balancer for MariaDB Xpand. For additional information, see "Configure HAProxy for MariaDB Xpand".

Accessing Xpand from the Command Line

To access Xpand from the command line, run MySQL from a command line prompt.

shell> mysql
sql> SELECT * FROM test.sample ORDER BY birth;
+------------+------------+------------+-----+
| name       | birth      | death      | sex |
+------------+------------+------------+-----+
| Rowinsky   | 1952-08-01 | NULL       | F   |
| Snyder     | 1955-11-26 | 2014-05-17 | M   |
| Thompson   | 1965-03-09 | NULL       | F   |
| Johnson    | 1980-06-11 | NULL       | M   |
+------------+------------+------------+-----+
4 rows in set (0.00 sec)

Because Xpand is MySQL compatible, many third party tools such as MySQLWorkbench, TOAD, etc. will work seamlessly with Xpand.

For additional information, see "Connect and Query".

Loading Data onto Xpand

Depending on your specific needs, there are numerous options for loading data onto Xpand:

  • Xpand recommends using clustrix_import if your source database is MySQL or you have a mysqldump file available. This is the fastest method for loading data onto Xpand from another system.

  • To cut over a production environment from MySQL to Xpand, you can use MySQL replication as outlined in "Migrate from MySQL to MariaDB Xpand".

  • To transfer user accounts and permissions, use clustrix_clone_users as documented in "Migrate User Permissions to MariaDB Xpand".

  • Load Data Infile can also be used to import data directly to Xpand from a csv file.

For additional information, see "Data Import with MariaDB Xpand".

Web-based Cluster Administration

Xpand includes XpandGUI Administration UI for cluster administration.

For additional information, see "XpandGUI for MariaDB Xpand".

Examining Xpand Server Logs

Xpand's server logs enable users and Customer Support to understand the queries and events that occur on a Xpand cluster. All the logs created by Xpand are placed, by default, in the /data/clustrix/log directory (this is configurable) and there are a separate set of logs for each node of your cluster. The logs used most frequently are query.log and clustrix.log.

The query.log shows information for SQL statements used within Xpand. From the query.log you can identify slow queries as well as query syntax errors. For additional information, see "Query Logging for MariaDB Xpand".

The clustrix.log is a chronology of events that occur on your cluster. It includes alerts that are also logged to a separate log file - alert.log. Please see "Email Alerts for MariaDB Xpand" to establish the necessary alerts for your cluster.

For additional information, see "Logging for MariaDB Xpand".

Using CLX - Cluster-Wide Command Line Utility

Xpand includes a general-purpose command line utility called clx for monitoring and managing a cluster. A single clx command is automatically processed in parallel on all nodes of a cluster. It is located in the /opt/clustrix/bin/ directory.

The full list of clx commands and options are outlined in The CLX Command-Line Administration Tool. These commands are likely to be the most useful.

Useful CLX Commands

Description

clx status

Displays the status, IP, and disk utilization of each node in a cluster.

clx cmd

Runs Linux commands in parallel on all nodes of the cluster.

clx logdump

Consolidates and filters Xpand logs so database issues can be researched and resolved.

clx dbstop

Stops Xpand on all nodes.

clx dbstart

Starts Xpand on all nodes.

clx dbrestart

Restarts Xpand on all nodes. (Use in lieu of dbstop/dbstart when applicable.)

Xpand's clx utility also communicates with another critical element of the system called nanny. The nanny is a database cluster process that provides monitoring to ensure that all processes vital to Xpand node functionality are running. It is activated at system startup. If any critical Xpand component fails at any point, for any reason, nanny restarts it automatically.

For a list of the processes that nanny monitors and controls, please refer to this "Nanny Overview for MariaDB Xpand".

Monitoring Xpand Using statd

Performance statistics are automatically collected by statd in the clustrix_statd database. The resulting statistics can be assessed by querying the tables directly or by viewing them with the XpandGUI administrative tool.

For a recap of the statistics gathered and some potential ways to analyze them, see "Monitoring with statd for MariaDB Xpand".

Upgrading Xpand

Xpand regularly provides both major and minor releases to continuously improve its product's performance, functionality, scalability, and stability. Each release passes a thorough and rigorous quality assurance process before it is released to our customers.

For specifics on how to upgrade Xpand, see "Upgrades for MariaDB Xpand".

Expanding/Reducing Your Cluster's Capacity

Your application and database may experience fluctuating transaction volumes due to seasonal changes. The underlying design of Xpand enables it to easily and uniquely adapt to those changes. To increase your cluster's capacity, simply add more nodes. Conversely, if transaction volume subsequently declines, removing nodes to decrease costs is equally painless.

For additional information, see "Scale-Out with MariaDB Xpand" and "Scale-In with MariaDB Xpand".

Parallel Backup and Restore

Xpand includes a fast parallel backup and restore feature. For backups, each Xpand node sends its data directly to the backup target in parallel, allowing for concurrency and for backup performance to scale with cluster size. Similarly, the restore operation is initiated on one node and that node coordinates with all other nodes of the cluster to read from the backup file and restore data throughout the cluster in parallel.

The Xpand database backups contain schema definitions, metadata relative to the backup, compacted row data, and information to ensure data consistency.

For additional information, see "Fast Backup and Restore with MariaDB Xpand".