Puppet Class: profile::druid::overlord

Defined in:
modules/profile/manifests/druid/overlord.pp

Overview

SPDX-License-Identifier: Apache-2.0 Class: profile::druid::overlord

Parameters:

  • properties (Hash[String, Any]) (defaults to: lookup('profile::druid::overlord::properties', {'default_value' => {}}))
  • env (Hash[String, String]) (defaults to: lookup('profile::druid::overlord::env', {'default_value' => {}}))
  • firewall_access (Optional[Array[String]]) (defaults to: lookup('profile::druid::overlord::firewall_access'))
  • daemon_autoreload (Boolean) (defaults to: lookup('profile::druid::daemons_autoreload', {'default_value' => true}))
  • monitoring_enabled (Boolean) (defaults to: lookup('profile::druid::overlord::monitoring_enabled', {'default_value' => false}))


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
# File 'modules/profile/manifests/druid/overlord.pp', line 4

class profile::druid::overlord(
    Hash[String, Any] $properties            = lookup('profile::druid::overlord::properties', {'default_value' => {}}),
    Hash[String, String] $env                = lookup('profile::druid::overlord::env', {'default_value' => {}}),
    Optional[Array[String]] $firewall_access = lookup('profile::druid::overlord::firewall_access'),
    Boolean $daemon_autoreload               = lookup('profile::druid::daemons_autoreload', {'default_value' => true}),
    Boolean $monitoring_enabled              = lookup('profile::druid::overlord::monitoring_enabled', {'default_value' => false}),
) {

    require ::profile::druid::common

    # If monitoring is enabled, then include the monitoring profile and set $java_opts
    # for exposing the Prometheus JMX Exporter in the Druid Broker process.
    if $monitoring_enabled {
        require ::profile::druid::monitoring::overlord
        $java_opts = $::profile::druid::monitoring::overlord::java_opts

        if $env['DRUID_EXTRA_JVM_OPTS'] {
            $monitoring_env_vars = {
                'DRUID_EXTRA_JVM_OPTS' => "${env['DRUID_EXTRA_JVM_OPTS']} ${java_opts}"
            }
        } else {
            $monitoring_env_vars = {
                'DRUID_EXTRA_JVM_OPTS' => $java_opts
            }
        }
    } else {
        $monitoring_env_vars = {}
    }

    $class_prefix = 'org.apache.druid'

    # Druid overlord Service
    class { '::druid::overlord':
        properties       => $properties,
        env              => merge($env, $monitoring_env_vars),
        should_subscribe => $daemon_autoreload,
        logger_prefix    => $class_prefix,
    }

    firewall::service { 'druid-overlord':
        proto    => 'tcp',
        port     => $::druid::overlord::runtime_properties['druid.port'],
        src_sets => $firewall_access,
    }

    if $monitoring_enabled {
        nrpe::monitor_service { 'druid-overlord':
            description  => 'Druid overlord',
            nrpe_command => "/usr/lib/nagios/plugins/check_procs -c 1:1 -C java -a \'${class_prefix}.cli.Main server overlord\'",
            critical     => false,
            notes_url    => 'https://wikitech.wikimedia.org/wiki/Analytics/Systems/Druid',
        }
    }
}