MaxCtrl Commands for MariaDB MaxScale

Overview

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

Reference material is available for MariaDB MaxScale.

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.

MaxCtrl Commands by MariaDB MaxScale Version

Choose a version of MariaDB MaxScale to see the MaxCtrl Commands supported by that version:

Support Matrix by Version

A summary of MaxCtrl Commands across MariaDB MaxScale versions:

Command

In 22.08?

In 6?

In 2.5?

In 2.4?

alter

22.08

6

2.5

2.4

alter filter

22.08

6

alter listener

22.08

6

alter logging

22.08

6

2.5

2.4

alter maxscale

22.08

6

2.5

2.4

alter monitor

22.08

6

2.5

2.4

alter server

22.08

6

2.5

2.4

alter service

22.08

6

2.5

2.4

alter service-filters

22.08

6

2.5

2.4

alter session

22.08

6

alter session-filters

22.08

6

alter user

22.08

6

2.5

2.4

api

22.08

6

2.5

2.4

api get

22.08

6

2.5

2.4

api patch

22.08

6

api post

22.08

6

call

22.08

6

2.5

2.4

call command

22.08

6

2.5

2.4

classify

22.08

6

2.5

2.4

clear

22.08

6

2.5

2.4

clear server

22.08

6

2.5

2.4

cluster

22.08

6

2.5

2.4

cluster diff

22.08

6

2.5

2.4

cluster sync

22.08

6

2.5

2.4

create

22.08

6

2.5

2.4

create filter

22.08

6

2.5

2.4

create listener

22.08

6

2.5

2.4

create monitor

22.08

6

2.5

2.4

create report

22.08

6

2.5

create server

22.08

6

2.5

2.4

create service

22.08

6

2.5

2.4

create user

22.08

6

2.5

2.4

destroy

22.08

6

2.5

2.4

destroy filter

22.08

6

2.5

2.4

destroy listener

22.08

6

2.5

2.4

destroy monitor

22.08

6

2.5

2.4

destroy server

22.08

6

2.5

2.4

destroy service

22.08

6

2.5

2.4

destroy session

22.08

destroy user

22.08

6

2.5

2.4

disable

22.08

6

2.5

2.4

disable account

2.4

disable log-priority

22.08

6

2.5

2.4

drain

22.08

6

2.5

2.4

drain server

22.08

6

2.5

2.4

enable

22.08

6

2.5

2.4

enable account

2.4

enable log-priority

22.08

6

2.5

2.4

link

22.08

6

2.5

2.4

link monitor

22.08

6

2.5

2.4

link service

22.08

6

2.5

2.4

list

22.08

6

2.5

2.4

list commands

22.08

6

2.5

2.4

list filters

22.08

6

2.5

2.4

list listeners

22.08

6

2.5

2.4

list modules

22.08

6

2.5

2.4

list monitors

22.08

6

2.5

2.4

list queries

22.08

6

list servers

22.08

6

2.5

2.4

list services

22.08

6

2.5

2.4

list sessions

22.08

6

2.5

2.4

list threads

22.08

6

2.5

2.4

list users

22.08

6

2.5

2.4

reload

22.08

6

2.5

2.4

reload service

22.08

6

2.5

2.4

reload session

22.08

reload sessions

22.08

reload tls

22.08

rotate

22.08

6

2.5

2.4

rotate logs

22.08

6

2.5

2.4

set

22.08

6

2.5

2.4

set server

22.08

6

2.5

2.4

show

22.08

6

2.5

2.4

show commands

22.08

6

2.5

2.4

show dbusers

22.08

6

2.5

2.4

show filter

22.08

6

2.5

2.4

show filters

22.08

6

2.5

2.4

show listener

22.08

6

2.5

show listeners

22.08

6

2.5

show logging

22.08

6

2.5

2.4

show maxscale

22.08

6

2.5

2.4

show module

22.08

6

2.5

2.4

show modules

22.08

6

2.5

2.4

show monitor

22.08

6

2.5

2.4

show monitors

22.08

6

2.5

2.4

show qc_cache

22.08

6

2.5

2.4

show server

22.08

6

2.5

2.4

show servers

22.08

6

2.5

2.4

show service

22.08

6

2.5

2.4

show services

22.08

6

2.5

2.4

show session

22.08

6

2.5

2.4

show sessions

22.08

6

2.5

2.4

show thread

22.08

6

2.5

2.4

show threads

22.08

6

2.5

2.4

start

22.08

6

2.5

2.4

start listener

22.08

6

start monitor

22.08

6

2.5

2.4

start service

22.08

6

2.5

2.4

start services

22.08

6

2.5

2.4

stop

22.08

6

2.5

2.4

stop listener

22.08

6

stop monitor

22.08

6

2.5

2.4

stop service

22.08

6

2.5

2.4

stop services

22.08

6

2.5

2.4

unlink

22.08

6

2.5

2.4

unlink monitor

22.08

6

2.5

2.4

unlink service

22.08

6

2.5

2.4

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