You are browsing a read-only backup copy of Wikitech. The live site can be found at


From Wikitech-static
< MariaDB
Revision as of 13:39, 4 June 2021 by imported>Kormat (Minor grammar fix.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Our database hosts can run either a single mariadb instance (single-instance) or multiple (multi-instance). This affects how they are addressed over the network, and the systemd setup within the host itself.

Single-instance hosts

Mariadb runs on port :3306, and is controlled by the mariadb.service systemd unit. Monitoring is provided by the prometheus-mysqld-exporter.service unit.

Multi-instance hosts

The mariadb port and systemd unit name are determined by the sections the host is in.

The mapping from section to port is controlled by this list. s1 instances on multi-instances hosts run on :3311, m5 multi-instances run on :3325, and so on.

The systemd unit is more straight-forward, it's mariadb@<section>.service. So s4 would be mariadb@s4.service.

Monitoring uses the same scheme. E.g. the exporter for m3 on multi-instance hosts is prometheus-mysqld-exporter@m3.service.

Determining if a host is single- or multi-instance

The simplest clue is to look at the motd on login. For example:

db1159 is a Misc DB Server (mariadb::core)
DB section m1
The last Puppet run was at Fri Jun  4 13:11:28 UTC 2021 (12 minutes ago). 

This is a single-instance host; there's only one section listed. Compare with:

dbstore1005 is a DBStore multi-instance server (mariadb::dbstore_multiinstance)
DB section s6
DB section s8
DB section staging
DB section x1
The last Puppet run was at Fri Jun  4 13:17:58 UTC 2021 (8 minutes ago). 

This is a multi-instance host; it has 4 sections listed.

This page is a part of the SRE Data Persistence technical documentation
(go here for a list of all our pages)