Puppet Class: profile::druid::common

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

Overview

Class profile::druid::common

Installs the druid common package and common configuration settings.

Druid module parameters are configured via hiera.

You will likely not need to explicity include this module since it is a dependency of other ones like profile::druid::broker/etc..

Druid Zookeeper settings will default to using the hosts in the hiera zookeeper_cluster_name and zookeeper_clusters hiera variables.

Parameters:

  • druid_cluster_name (Any) (defaults to: hiera('profile::druid::common::druid_cluster_name'))
  • zookeeper_cluster_name (Any) (defaults to: hiera('profile::druid::common::zookeeper_cluster_name'))
  • private_properties (Any) (defaults to: hiera('profile::druid::common::private_properties', {}))
  • properties (Any) (defaults to: hiera('profile::druid::common::properties', {}))
  • zookeeper_clusters (Any) (defaults to: hiera('zookeeper_clusters'))
  • metadata_storage_database_name (Any) (defaults to: hiera('profile::druid::common:metadata_storage_database_name', 'druid'))
  • java_home (Any) (defaults to: hiera('profile::druid::common::java_home', '/usr/lib/jvm/java-8-openjdk-amd64'))
  • use_cdh_hadoop_config (Any) (defaults to: hiera('profile::druid::common::use_cdh_hadoop_config', false))
  • use_cdh (Any) (defaults to: hiera('profile::druid::common::use_cdh', false))


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

class profile::druid::common(
    $druid_cluster_name             = hiera('profile::druid::common::druid_cluster_name'),
    $zookeeper_cluster_name         = hiera('profile::druid::common::zookeeper_cluster_name'),
    $private_properties             = hiera('profile::druid::common::private_properties', {}),
    $properties                     = hiera('profile::druid::common::properties', {}),
    $zookeeper_clusters             = hiera('zookeeper_clusters'),
    $metadata_storage_database_name = hiera('profile::druid::common:metadata_storage_database_name', 'druid'),
    $java_home                      = hiera('profile::druid::common::java_home', '/usr/lib/jvm/java-8-openjdk-amd64'),
    $use_cdh_hadoop_config          = hiera('profile::druid::common::use_cdh_hadoop_config', false),
    $use_cdh                        = hiera('profile::druid::common::use_cdh', false),
) {

    # Need Java before Druid is installed.
    Class['profile::java'] -> Class['profile::druid::common']

    # Only need a Hadoop client if we are using CDH.
    if $use_cdh_hadoop_config or $use_cdh {
        require ::profile::hadoop::common
    }

    $zookeeper_hosts        = keys($zookeeper_clusters[$zookeeper_cluster_name]['hosts'])
    $zookeeper_chroot       = "/druid/${druid_cluster_name}"
    $zookeeper_properties   = {
        'druid.zk.paths.base'          => $zookeeper_chroot,
        'druid.discovery.curator.path' => "${zookeeper_chroot}/discovery",
        'druid.zk.service.host'        => join($zookeeper_hosts, ',')
    }

    # Druid Common Class
    class { '::druid':
        metadata_storage_database_name => $metadata_storage_database_name,
        java_home                      => $java_home,
        use_cdh                        => $use_cdh,
        # Merge our auto configured zookeeper properties
        # with the properties from hiera.
        properties                     => merge(
            $zookeeper_properties,
            $properties,
            $private_properties
        ),
    }
}