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

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

Overview

Class profile::mariadb::misc::analytics::multiinstance

The Analytics team manages multiple small databases related to their tools (Superset, Druid, Matomo, etc..) and this profile implements a mariadb multi-instance environment that can be used as replica.

Parameters:

  • num_instances (Integer) (defaults to: lookup('profile::mariadb::misc::analytics::multiinstance::num_instances'))
  • matomo (Optional[String]) (defaults to: lookup('profile::mariadb::misc::analytics::multiinstance::matomo', { 'default_value' => undef }))
  • analytics_meta (Optional[String]) (defaults to: lookup('profile::mariadb::misc::analytics::multiinstance::analytics_meta', { 'default_value' => undef }))


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/misc/analytics/multiinstance.pp', line 7

class profile::mariadb::misc::analytics::multiinstance (
    Integer $num_instances           = lookup('profile::mariadb::misc::analytics::multiinstance::num_instances'),
    Optional[String] $matomo         = lookup('profile::mariadb::misc::analytics::multiinstance::matomo', { 'default_value' => undef }),
    Optional[String] $analytics_meta = lookup('profile::mariadb::misc::analytics::multiinstance::analytics_meta', { 'default_value' => undef }),
) {
    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-mariadb104'
    class { 'mariadb::config':
        basedir       => $basedir,
        config        => 'profile/mariadb/mysqld_config/misc_multiinstance.my.cnf.erb',
        p_s           => 'on',
        ssl           => 'puppet-cert',
        binlog_format => 'ROW',
        read_only     => 1,
    }

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

    if $matomo {
        mariadb::instance { 'matomo':
            port                    => 3351,
            innodb_buffer_pool_size => $matomo,
        }
        profile::mariadb::section { 'matomo': }
        profile::mariadb::ferm { 'matomo': port => '3351' }
        profile::prometheus::mysqld_exporter_instance { 'matomo': port => 13351, }
    }
    if $analytics_meta {
        mariadb::instance { 'analytics_meta':
            port                    => 3352,
            innodb_buffer_pool_size => $analytics_meta,
        }
        profile::mariadb::section { 'analytics_meta': }
        profile::mariadb::ferm { 'analytics_meta': port => '3352' }
        profile::prometheus::mysqld_exporter_instance { 'analytics_meta': port => 13352, }
    }

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

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

    class { 'mariadb::monitor_memory': }
}