Puppet Class: profile::mariadb::dbstore_multiinstance

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

Overview

Parameters:

  • num_instances (Any) (defaults to: hiera('profile::mariadb::dbstore_multiinstance::num_instances'))
  • s1 (Any) (defaults to: hiera('profile::mariadb::dbstore_multiinstance::s1', false))
  • s2 (Any) (defaults to: hiera('profile::mariadb::dbstore_multiinstance::s2', false))
  • s3 (Any) (defaults to: hiera('profile::mariadb::dbstore_multiinstance::s3', false))
  • s4 (Any) (defaults to: hiera('profile::mariadb::dbstore_multiinstance::s4', false))
  • s5 (Any) (defaults to: hiera('profile::mariadb::dbstore_multiinstance::s5', false))
  • s6 (Any) (defaults to: hiera('profile::mariadb::dbstore_multiinstance::s6', false))
  • s7 (Any) (defaults to: hiera('profile::mariadb::dbstore_multiinstance::s7', false))
  • s8 (Any) (defaults to: hiera('profile::mariadb::dbstore_multiinstance::s8', false))
  • x1 (Any) (defaults to: hiera('profile::mariadb::dbstore_multiinstance::x1', false))
  • staging (Any) (defaults to: hiera('profile::mariadb::dbstore_multiinstance::staging', 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# File 'modules/profile/manifests/mariadb/dbstore_multiinstance.pp', line 1

class profile::mariadb::dbstore_multiinstance (
    $num_instances = hiera('profile::mariadb::dbstore_multiinstance::num_instances'),
    $s1            = hiera('profile::mariadb::dbstore_multiinstance::s1', false),
    $s2            = hiera('profile::mariadb::dbstore_multiinstance::s2', false),
    $s3            = hiera('profile::mariadb::dbstore_multiinstance::s3', false),
    $s4            = hiera('profile::mariadb::dbstore_multiinstance::s4', false),
    $s5            = hiera('profile::mariadb::dbstore_multiinstance::s5', false),
    $s6            = hiera('profile::mariadb::dbstore_multiinstance::s6', false),
    $s7            = hiera('profile::mariadb::dbstore_multiinstance::s7', false),
    $s8            = hiera('profile::mariadb::dbstore_multiinstance::s8', false),
    $x1            = hiera('profile::mariadb::dbstore_multiinstance::x1', false),
    # Analytics staging database
    $staging       = hiera('profile::mariadb::dbstore_multiinstance::staging', 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\"",
    }

    include ::profile::mariadb::mysql_role

    $basedir = '/opt/wmf-mariadb101'
    class { 'mariadb::config':
        datadir       => false,
        basedir       => $basedir,
        read_only     => 1,
        config        => 'role/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 Analytics SREs.
    #
    if $s1 {
        mariadb::instance { 's1':
            port                    => 3311,
            innodb_buffer_pool_size => $s1,
        }
        profile::mariadb::section { 's1': }
        profile::mariadb::ferm { 's1': port => '3311' }
        profile::prometheus::mysqld_exporter_instance { 's1': port => 13311, }
        profile::mariadb::replication_lag { 's1': prom_port => 13311, }
    }
    if $s2 {
        mariadb::instance { 's2':
            port                    => 3312,
            innodb_buffer_pool_size => $s2,
        }
        profile::mariadb::section { 's2': }
        profile::mariadb::ferm { 's2': port => '3312' }
        profile::prometheus::mysqld_exporter_instance { 's2': port => 13312, }
        profile::mariadb::replication_lag { 's2': prom_port => 13312, }
    }
    if $s3 {
        mariadb::instance { 's3':
            port                    => 3313,
            innodb_buffer_pool_size => $s3,
        }
        profile::mariadb::section { 's3': }
        profile::mariadb::ferm { 's3': port => '3313' }
        profile::prometheus::mysqld_exporter_instance { 's3': port => 13313, }
        profile::mariadb::replication_lag { 's3': prom_port => 13313, }
    }
    if $s4 {
        mariadb::instance { 's4':
            port                    => 3314,
            innodb_buffer_pool_size => $s4,
        }
        profile::mariadb::section { 's4': }
        profile::mariadb::ferm { 's4': port => '3314' }
        profile::prometheus::mysqld_exporter_instance { 's4': port => 13314, }
        profile::mariadb::replication_lag { 's4': prom_port => 13314, }
    }
    if $s5 {
        mariadb::instance { 's5':
            port                    => 3315,
            innodb_buffer_pool_size => $s5,
        }
        profile::mariadb::section { 's5': }
        profile::mariadb::ferm { 's5': port => '3315' }
        profile::prometheus::mysqld_exporter_instance { 's5': port => 13315, }
        profile::mariadb::replication_lag { 's5': prom_port => 13315, }
    }
    if $s6 {
        mariadb::instance { 's6':
            port                    => 3316,
            innodb_buffer_pool_size => $s6,
        }
        profile::mariadb::section { 's6': }
        profile::mariadb::ferm { 's6': port => '3316' }
        profile::prometheus::mysqld_exporter_instance { 's6': port => 13316, }
        profile::mariadb::replication_lag { 's6': prom_port => 13316, }
    }
    if $s7 {
        mariadb::instance { 's7':
            port                    => 3317,
            innodb_buffer_pool_size => $s7,
        }
        profile::mariadb::section { 's7': }
        profile::mariadb::ferm { 's7': port => '3317' }
        profile::prometheus::mysqld_exporter_instance { 's7': port => 13317, }
        profile::mariadb::replication_lag { 's7': prom_port => 13317, }
    }
    if $s8 {
        mariadb::instance { 's8':
            port                    => 3318,
            innodb_buffer_pool_size => $s8,
        }
        profile::mariadb::section { 's8': }
        profile::mariadb::ferm { 's8': port => '3318' }
        profile::prometheus::mysqld_exporter_instance { 's8': port => 13318, }
        profile::mariadb::replication_lag { 's8': prom_port => 13318, }
    }

    if $x1 {
        mariadb::instance { 'x1':
            port                    => 3320,
            innodb_buffer_pool_size => $x1,
        }
        profile::mariadb::section { 'x1': }
        profile::mariadb::ferm { 'x1': port => '3320' }
        profile::prometheus::mysqld_exporter_instance { 'x1': port => 13320, }
        profile::mariadb::replication_lag { 'x1': prom_port => 13320, }
    }

# Analytics staging database
    if $staging {
        mariadb::instance { 'staging':
            port                    => 3350,
            innodb_buffer_pool_size => $staging,
            read_only               => 0,
        }
        profile::mariadb::section { 'staging': }
        profile::mariadb::ferm { 'staging': port => '3350' }
        profile::prometheus::mysqld_exporter_instance { 'staging': port => 13350, }
        profile::mariadb::replication_lag { 'staging': prom_port => 13350, }
    }


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

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