Puppet Class: profile::mariadb::misc::multiinstance

Defined in:
modules/profile/manifests/mariadb/misc/multiinstance.pp

Overview

Parameters:

  • num_instances (Any) (defaults to: hiera('profile::mariadb::misc::multiinstance::num_instances'))
  • m1 (Any) (defaults to: hiera('profile::mariadb::misc::multiinstance::m1', false))
  • m2 (Any) (defaults to: hiera('profile::mariadb::misc::multiinstance::m2', false))
  • m3 (Any) (defaults to: hiera('profile::mariadb::misc::multiinstance::m3', false))
  • m5 (Any) (defaults to: hiera('profile::mariadb::misc::multiinstance::m5', false))


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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'modules/profile/manifests/mariadb/misc/multiinstance.pp', line 1

class profile::mariadb::misc::multiinstance (
    $num_instances = hiera('profile::mariadb::misc::multiinstance::num_instances'),
    $m1            = hiera('profile::mariadb::misc::multiinstance::m1', false),
    $m2            = hiera('profile::mariadb::misc::multiinstance::m2', false),
    $m3            = hiera('profile::mariadb::misc::multiinstance::m3', false),
    $m5            = hiera('profile::mariadb::misc::multiinstance::m5', false),
) {
    class { '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\"",
    }

    $basedir = '/opt/wmf-mariadb101'
    class { 'mariadb::config':
        datadir       => false,
        basedir       => $basedir,
        read_only     => 'ON',
        config        => 'profile/mariadb/mysqld_config/misc_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',
    }

    if $m1 {
        mariadb::instance { 'm1':
            port                    => 3321,
            innodb_buffer_pool_size => $m1,
            # template                => 'profile/mariadb/mysqld_config/misc.my.cnf.erb'
        }
        profile::mariadb::ferm { 'm1': port => '3321' }
        profile::prometheus::mysqld_exporter_instance { 'm1': port => 13321, }
    }
    if $m2 {
        mariadb::instance { 'm2':
            port                    => 3322,
            innodb_buffer_pool_size => $m2,
            # template                => 'profile/mariadb/mysqld_config/misc.my.cnf.erb'
        }
        profile::mariadb::ferm { 'm2': port => '3322' }
        profile::prometheus::mysqld_exporter_instance { 'm2': port => 13322, }
    }
    if $m3 {
        mariadb::instance { 'm3':
            port                    => 3323,
            innodb_buffer_pool_size => $m3,
            template                => 'profile/mariadb/mysqld_config/phabricator_instance.my.cnf.erb',
        }
        profile::mariadb::ferm { 'm3': port => '3323' }
        profile::prometheus::mysqld_exporter_instance { 'm3': port => 13323, }
        # stopwords are stored prersistently and backed up, so no need to load it every time
        file { '/etc/mysql/phabricator-init.sql':
            ensure => present,
            owner  => 'root',
            group  => 'root',
            mode   => '0644',
            source => 'puppet:///modules/profile/mariadb/phabricator-init.sql',
        }
    }
    if $m5 {
        mariadb::instance { 'm5':
            port                    => 3325,
            innodb_buffer_pool_size => $m5,
            # template                => 'profile/mariadb/mysqld_config/misc.my.cnf.erb'
        }
        profile::mariadb::ferm { 'm5': port => '3325' }
        include profile::mariadb::ferm_wmcs_on_port_3325
        profile::prometheus::mysqld_exporter_instance { 'm5': port => 13325, }
    }

    class { 'mariadb::monitor_disk':
        is_critical   => false,
        contact_group => 'admins',
    }

    class { 'mariadb::monitor_process':
        process_count => $num_instances,
        is_critical   => false,
        contact_group => 'admins',
    }
}