Puppet Class: profile::mariadb::dbstore_multiinstance

Defined in:
modules/profile/manifests/mariadb/dbstore_multiinstance.pp

Overview

Parameters:

  • instances (Hash[String, Stdlib::Datasize]) (defaults to: lookup('profile::mariadb::dbstore_multiinstance::instances'))
  • section_ports (Hash[String, Stdlib::Port]) (defaults to: lookup('profile::mariadb::section_ports'))


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'modules/profile/manifests/mariadb/dbstore_multiinstance.pp', line 1

class profile::mariadb::dbstore_multiinstance (
    Hash[String, Stdlib::Datasize] $instances = lookup('profile::mariadb::dbstore_multiinstance::instances'),
    Hash[String, Stdlib::Port] $section_ports = lookup('profile::mariadb::section_ports'),
) {
    require profile::mariadb::packages_wmf
    class { 'mariadb::service':
        override => "[Service]\nExecStartPre=/bin/sh -c \"echo 'mariadb main service is \
disabled, use mariadb@<instance_name> instead'; exit 1\"",
    }

    include ::profile::mariadb::mysql_role
    include profile::mariadb::wmfmariadbpy

    class { 'mariadb::config':
        datadir       => false,
        basedir       => $profile::mariadb::packages_wmf::basedir,
        read_only     => 1,
        config        => 'profile/mariadb/mysqld_config/dbstore_multiinstance.my.cnf.erb',
        p_s           => 'on',
        ssl           => 'puppet-cert',
        binlog_format => 'ROW',
    }

    file { '/etc/mysql/mysqld.conf.d':
        ensure => directory,
        owner  => root,
        group  => root,
        mode   => '0755',
    }

    # Note for Analytics dbstores:
    #
    # In case you change the following settings, please make sure
    # that the following is consistent:
    # 1) Analytics' DNS CNAMEs and SRV records
    # 2) Analytics VLAN's firewall rules
    # For more info ping one of the Data Engineering SREs.

    $instances.each |$section, $buffer_pool| {
        $port = $section_ports[$section]
        if (!$port) {
            fail("'${section}' is not a valid section.")
        }
        $prom_port = Integer("1${port}")

        $read_only = $section ? {
            default => undef,
            'staging' => 0,
        }

        mariadb::instance { $section:
            port                    => $port,
            innodb_buffer_pool_size => $buffer_pool,
            read_only               => $read_only,
        }
        profile::mariadb::section { $section: mention_alias => true }
        profile::mariadb::ferm { $section: port => $port, }
        profile::prometheus::mysqld_exporter_instance { $section: port => $prom_port }
    }

    class { 'mariadb::monitor_disk': }

    class { 'mariadb::monitor_process':
        process_count => length($instances),
    }

    class { 'mariadb::monitor_memory': }
}