Puppet Class: profile::cassandra::single_instance

Defined in:
modules/profile/manifests/cassandra/single_instance.pp

Overview

Parameters:

  • graphite_host (Stdlib::Host) (defaults to: lookup('graphite_host'))
  • cluster_name (String) (defaults to: lookup('cluster'))
  • prometheus_nodes (Array[Stdlib::Host]) (defaults to: lookup('prometheus_nodes'))
  • cassandra_hosts (Array[Stdlib::Host]) (defaults to: lookup('profile::cassandra::single_instance::seeds'))
  • dc (String) (defaults to: lookup('profile::cassandra::single_instance::dc'))
  • super_pass (String) (defaults to: lookup('profile::cassandra::single_instance::super_pass'))
  • jmx_exporter_enabled (Boolean) (defaults to: lookup('profile::cassandra::single_instance::jmx_exporter_enabled'))


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
# File 'modules/profile/manifests/cassandra/single_instance.pp', line 1

class profile::cassandra::single_instance(
  Stdlib::Host        $graphite_host        = lookup('graphite_host'),
  String              $cluster_name         = lookup('cluster'),
  Array[Stdlib::Host] $prometheus_nodes     = lookup('prometheus_nodes'),
  Array[Stdlib::Host] $cassandra_hosts      = lookup('profile::cassandra::single_instance::seeds'),
  String              $dc                   = lookup('profile::cassandra::single_instance::dc'),
  String              $super_pass           = lookup('profile::cassandra::single_instance::super_pass'),
  Boolean             $jmx_exporter_enabled = lookup('profile::cassandra::single_instance::jmx_exporter_enabled'),
) {
  # localhost udp endpoint for logging pipeline
  class { 'profile::rsyslog::udp_json_logback_compat': }

  class { 'cassandra':
    cluster_name            => $cluster_name,
    seeds                   => $cassandra_hosts,
    dc                      => $dc,
    logstash_host           => 'localhost',
    default_instance_params => {
      data_directory_base    => '/srv/cassandra',
      commitlog_directory    => '/srv/cassandra/commitlog',
      saved_caches_directory => '/srv/cassandra/saved_caches',
      super_password         => $super_pass,
      jmx_exporter_enabled   => $jmx_exporter_enabled,
    }
  }
  class { 'cassandra::metrics':
    graphite_host => $graphite_host,
  }
  class {'cassandra::logging': }

  cassandra::instance::monitoring { 'default':
    instances => {
      'default' => {
        'listen_address' => $::cassandra::listen_address,
      }
    },
  }

  $cassandra_hosts_ferm = join($cassandra_hosts, ' ')
  $prometheus_nodes_ferm = join($prometheus_nodes, ' ')

  # Cassandra intra-node messaging
  ferm::service { 'maps-cassandra-intra-node':
    proto  => 'tcp',
    port   => '7000',
    srange => "(${cassandra_hosts_ferm})",
  }

  # Cassandra JMX/RMI
  ferm::service { 'maps-cassandra-jmx-rmi':
    proto  => 'tcp',
    # hardcoded limit of 4 instances per host
    port   => '7199',
    srange => "(${cassandra_hosts_ferm})",
  }

  # Cassandra CQL query interface
  ferm::service { 'cassandra-cql':
    proto  => 'tcp',
    port   => '9042',
    srange => "(${cassandra_hosts_ferm})",
  }

  # Prometheus jmx_exporter for Cassandra
  ferm::service { 'cassandra-jmx_exporter':
      proto  => 'tcp',
      port   => '7800',
      srange => "@resolve((${prometheus_nodes_ferm}))",
  }

  # Cassandra Thrift interface, used by cqlsh
  # TODO: Is that really true? Since CQL 3.0 it should not be. Revisit
  ferm::service { 'cassandra-cql-thrift':
    proto  => 'tcp',
    port   => '9160',
    srange => "(${cassandra_hosts_ferm})",
  }

}