MaxCtrl Commands for MariaDB MaxScale 2.5

Overview

MariaDB MaxScale 2.5 ships with a command-line utility and administrative console called MaxCtrl (maxctrl) to configure and manage MariaDB Enterprise deployments through the MaxScale REST API. MaxCtrl supports many different commands.

Reference material is available for MariaDB MaxScale 2.5.

Usage

MaxCtrl commands can be run as command-line arguments:

$ maxctrl show services

Alternatively, if you need to execute several commands, you can open the administrative console by running MaxCtrl without arguments:

$ maxctrl

If authentication is enabled for MaxScale's REST API, the user name and password can be provided via the --user and --password options:

$ maxctrl --user='maxscale' \
   --password='secure-password' \
   show services

The default user name is admin, and the default password is mariadb.

MariaDB MaxScale 2.5 MaxCtrl Commands

The following MaxCtrl Commands are supported by MariaDB MaxScale 2.5:

Command

Description

alter

<command>

alter logging

Modifies global logging configuration

alter maxscale

Modifies global MaxScale configuration

alter monitor

Modifies parameters for a monitor

alter server

Modifes parameters for a server module

alter service

Modifies configuration for a service

alter service-filters

Modifies configuration for a filter service

alter user

Changes password for a network user

api

<command>

api get

Retrieves raw JSON from MaxScale API

call

<command>

call command

Executes a command on the given module

classify

Classifies the given statement

clear

<command>

clear server

Clears the server module state

cluster

<command>

cluster diff

Shows the differences between host servers and the target MariaDB MaxScale server

cluster sync

Synchronizes the cluster with the target MariaDB MaxScale server

create

<command>

create filter

Creates a new filter service

create listener

Creates a new listener service

create monitor

Creates a new monitor

create report

<file>

create server

Creates a new server module

create service

Creates a new service

create user

Creates a new network user

destroy

<command>

destroy filter

Removes a filter service

destroy listener

Removes a listener service

destroy monitor

Removes a monitor

destroy server

Removes a server module

destroy service

Removes a service

destroy user

Removes a network user

disable

<command>

disable log-priority

Disables logging messages of the given priority level

drain

<command>

drain server

Removes the given server module from the connection pool

enable

<command>

enable log-priority

Enables logging messages of the given priority level

link

<command>

link monitor

Links server modules to the given monitor

link service

Links server modules to the given service

list

<command>

list commands

Lists commands for configured modules

list filters

Lists configured filter services

list listeners

Lists listeners for the given service

list modules

Lists modules currently loaded

list monitors

Lists monitors

list servers

Lists configured server modules

list services

Lists configured services

list sessions

Lists current sessions

list threads

Lists threads in use

list users

Lists network users

reload

<command>

reload service

<service>

rotate

<command>

rotate logs

Rotates logs (closes and reopens log files)

set

<command>

set server

Configures the state of the given server module

show

<command>

show commands

Displays commands available to the given module

show dbusers

<service>

show filter

Displays the configuration of the given filter service

show filters

Displays the configuration of all filter services

show listener

<listener>

show listeners

show logging

Displays the logging configuration

show maxscale

Displays the global MariaDB MaxScale configuration

show module

Displays the configuration of the given module

show modules

Displays the configuration of all modules

show monitor

Displays the configuration of the given monitor

show monitors

Displays the configuration of all monitors

show qc_cache

show server

Displays the configuration of the given server module

show servers

Displays the configuration of all server modules

show service

Displays the configuration of the given service

show services

Displays the configuration of all services

show session

Displays information on the given session

show sessions

Displays information on all sessions

show thread

Displays information on the given thread

show threads

Displays information on all threads

start

<command>

start monitor

Starts the given monitor

start service

Starts the given service

start services

Starts all services

stop

<command>

stop monitor

Stops the given monitor

stop service

Stops the given service

stop services

Stops all services

unlink

<command>

unlink monitor

Removes link from server modules to the given monitor

unlink service

Removes link from server modules to the given service

To see MaxCtrl Commands supported in other versions, see "MaxCtrl Commands by MariaDB MaxScale Version".

Configuration File

MaxCtrl reads command-line options from the ~/.maxctrl.cnf configuration file.

The configuration file can be used to store common options, such as the user name and password:

[maxctrl]
user = maxscale
password = secure-password

MaxCtrl will refuse to use the ~/.maxctrl.cnf configuration file if it can be accessed by anyone other than the owner. Ensure that only the owner can access the file using the following command:

$ chown 0600 ~/.maxctrl.cnf

MaxCtrl can use a different configuration file by specifying the -c or --config option:

$ maxctrl --config=/maxscale/maxctrl.cnf \
   show services