MaxCtrl Commands for MariaDB MaxScale 23.02

Overview

MariaDB MaxScale 23.02 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 23.02.

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 23.02 MaxCtrl Commands

The following MaxCtrl Commands are supported by MariaDB MaxScale 23.02:

Command

Description

alter

alter filter

alter listener

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 session

alter session-filters

alter user

Changes password for a network user

api

api get

Retrieves raw JSON from MaxScale API

api patch

api post

call

call command

Executes a command on the given module

classify

Classifies the given statement

clear

clear server

Clears the server module state

create

create filter

Creates a new filter service

create listener

Creates a new listener service

create monitor

Creates a new monitor

create report

Generates a report describing the state of all MaxScale objects

create server

Creates a new server module

create service

Creates a new service

create user

Creates a new network user

destroy

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 session

destroy user

Removes a network user

disable

disable log-priority

Disables logging messages of the given priority level

enable

enable log-priority

Enables logging messages of the given priority level

link

link monitor

Links server modules to the given monitor

link service

Links server modules to the given service

list

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 queries

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

reload service

reload session

reload sessions

reload tls

rotate

rotate logs

Rotates logs (closes and reopens log files)

set

set server

Configures the state of the given server module

show

show commands

Displays commands available to the given module

show dbusers

show filter

Displays the configuration of the given filter service

show filters

Displays the configuration of all filter services

show 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

start listener

start monitor

Starts the given monitor

start service

Starts the given service

start services

Starts all services

stop

stop listener

stop monitor

Stops the given monitor

stop service

Stops the given service

stop services

Stops all services

unlink

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