Start and Stop Services
This page is part of MariaDB's Documentation.
The parent of this page is: Operations
Topics on this page:
Overview
The services for MariaDB Enterprise Server and MariaDB MaxScale are managed by systemd
in most environments, but other options are supported in some cases.
Compatibility
MariaDB Enterprise Server 10.3
MariaDB Enterprise Server 10.4
MariaDB Enterprise Server 10.5
MariaDB Enterprise Server 10.6
MariaDB MaxScale 2.5
MariaDB MaxScale 6
MariaDB MaxScale 22.08
MariaDB MaxScale 23.02
systemd
MariaDB Enterprise Server
In environments that use systemd
for service management, the systemctl
command is used to start and stop the MariaDB Enterprise Server service:
Operation | Command |
---|---|
Start |
|
Stop |
|
Restart |
|
Enable during startup |
|
Disable during startup |
|
Status |
|
View |
|
| |
Recover Galera Cluster's position |
|
MariaDB MaxScale
In environments that use systemd
for service management, the systemctl
command is used to start and stop the MariaDB MaxScale service:
Operation | Command |
---|---|
Start |
|
Stop |
|
Restart |
|
Enable during startup |
|
Disable during startup |
|
Status |
|
View |
|
Enterprise Server Shutdown Considerations
Shutdown via SQL
MariaDB Enterprise Server can be shutdown via SQL using the SHUTDOWN
statement:
SHUTDOWN;
This statement requires the SHUTDOWN
privilege.
Shutdown via mariadb-admin
MariaDB Enterprise Server can be shutdown via the mariadb-admin shutdown
command:
$ sudo mariadb-admin --user=root shutdown
The database user account requires the SHUTDOWN
privilege.
Shutdown via SIGTERM
On Linux, MariaDB Enterprise Server performs a shutdown if it receives a SIGTERM
(signal 15).
To shutdown MariaDB Enterprise Server by sending it a SIGTERM
:
Find the process ID of
mariadbd
:$ export MARIADBD_PID=$(sudo pidof mariadbd)
Send
SIGTERM
to the process using thekill
utility:$ sudo kill -SIGTERM $MARIADBD_PID
Shutdown for Upgrades
When preparing to perform an upgrade, MariaDB recommends setting the innodb_fast_shutdown
system variable to 0
before shutting down the mariadbd
process.
The system variable can be configured dynamically using the SET GLOBAL
statement:
SET GLOBAL innodb_fast_shutdown=0;
This statement requires the SUPER
privilege.
Shutdown a Primary Server
In some cases, special care must be taken when shutting down a primary server when using MariaDB Replication.
For additional information, see "Stop a Primary Node".
Bootstrap a Galera Cluster
When a Galera Cluster node starts by default, it tries to establish a connection to the other cluster nodes configured in the wsrep_cluster_address
system variable. The node does not become active until it connects to another cluster node that belongs to the Primary Component. Consequently, if all nodes in a cluster are offline, you must start the first node using a special method, so that it does not abort startup when it can't establish a connection with any other cluster nodes. The special method is known as bootstrapping the cluster.
For information on how to bootstrap a Galera Cluster, see "Bootstrap a Galera Cluster".