Puppet Class: profile::cassandra::single_instance

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

Overview

Parameters:

  • cassandra_hosts (Any) (defaults to: hiera('profile::cassandra::single_instance::seeds'))
  • cluster_name (Any) (defaults to: hiera('cluster'))
  • prometheus_nodes (Any) (defaults to: hiera('prometheus_nodes'))
  • graphite_host (Any) (defaults to: hiera('profile::cassandra::single_instance::graphite_host'))
  • dc (Any) (defaults to: hiera('profile::cassandra::single_instance::dc'))
  • super_pass (Any) (defaults to: hiera('profile::cassandra::single_instance::super_pass'))
  • jmx_exporter_enabled (Any) (defaults to: hiera('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(
  $cassandra_hosts = hiera('profile::cassandra::single_instance::seeds'),
  $cluster_name = hiera('cluster'),
  $prometheus_nodes = hiera('prometheus_nodes'),
  $graphite_host = hiera('profile::cassandra::single_instance::graphite_host'),
  $dc = hiera('profile::cassandra::single_instance::dc'),
  $super_pass = hiera('profile::cassandra::single_instance::super_pass'),
  $jmx_exporter_enabled = hiera('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,
  }
  include ::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})",
  }

}