Puppet Class: profile::mjolnir::kafka_msearch_daemon

Defined in:
modules/profile/manifests/mjolnir/kafka_msearch_daemon.pp

Overview

Class: profile::mjolnir::kafka_daemon

This class sets up the MjoLniR kafka daemon which facilitates running elasticsearch queries against relforge from the analytics network by using kafka as a middleman.

Parameters:

  • kafka_cluster (Any) (defaults to: hiera('profile::mjolnir::kafka_msearch_daemon::kafka_cluster'))
  • input_topic (String) (defaults to: hiera('profile::mjolnir::kafka_msearch_daemon::input_topic'))
  • output_topic (String) (defaults to: hiera('profile::mjolnir::kafka_msearch_daemon::output_topic'))
  • num_workers (Integer) (defaults to: hiera('profile::mjolnir::kafka_msearch_daemon::num_workers'))
  • max_concurrent_searches (Integer) (defaults to: hiera('profile::mjolnir::kafka_msearch_daemon::max_concurrent_searches'))
  • prometheus_nodes (Array[String]) (defaults to: hiera('prometheus_nodes', []))


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
# File 'modules/profile/manifests/mjolnir/kafka_msearch_daemon.pp', line 7

class profile::mjolnir::kafka_msearch_daemon(
    $kafka_cluster = hiera('profile::mjolnir::kafka_msearch_daemon::kafka_cluster'),
    String $input_topic = hiera('profile::mjolnir::kafka_msearch_daemon::input_topic'),
    String $output_topic = hiera('profile::mjolnir::kafka_msearch_daemon::output_topic'),
    Integer $num_workers = hiera('profile::mjolnir::kafka_msearch_daemon::num_workers'),
    Integer $max_concurrent_searches = hiera('profile::mjolnir::kafka_msearch_daemon::max_concurrent_searches'),
    Array[String] $prometheus_nodes = hiera('prometheus_nodes', []),
) {
    require ::profile::mjolnir

    $prometheus_port = 9171
    $kafka_config = kafka_config($kafka_cluster)
    ::systemd::service { 'mjolnir-kafka-msearch-daemon':
        content => template('profile/mjolnir/kafka-msearch-daemon.service.erb'),
    }

    ::base::service_auto_restart { 'mjolnir-kafka-msearch-daemon': }

    $prometheus_nodes_ferm = join($prometheus_nodes, ' ')
    ferm::service { 'mjolnir-msearch-metrics':
        proto  => 'tcp',
        port   => $prometheus_port,
        srange => "(@resolve((${prometheus_nodes_ferm})) @resolve((${prometheus_nodes_ferm}), AAAA))",
    }
}