Puppet Class: cassandra

Defined in:
manifests/init.pp

Summary

This is the main entry point and API for Cassandra module.

Overview

Puppet module for Cassandra cluster which enables to install, configure and manage Cassandra nodes. The module consists of the install class, which is included first, followed by config and config::topology classes. Finally, the service class is included and notification from config are forwarded to service.

This class is the main class of this module and the only one which should be included in your node manifests. For documentation of the particular feature, refer to the reference documentation of the other components.

Examples:

include cassandra

Parameters:

  • cassandra_package (String) (defaults to: 'cassandra')

    name of the package to be installed

  • cassandra_ensure (String) (defaults to: 'installed')

    ensure clause for cassandra package

  • tools_package (String) (defaults to: 'cassandra-tools')

    package name of cassandra tools

  • tools_ensure (String) (defaults to: $cassandra_ensure)

    ensure clause for tools package

  • manage_service (Boolean) (defaults to: true)

    enables puppet to manage the service

  • service_ensure (Cassandra::Service::Ensure) (defaults to: undef)

    ensure clause for cassandra service

  • service_enable (Cassandra::Service::Enable) (defaults to: false)

    enable state of cassandra service

  • service_name (String) (defaults to: 'cassandra')

    the name of the cassandra service

  • config_dir (Stdlib::Absolutepath) (defaults to: '/etc/cassandra')

    cassandra configuration directory

  • environment (Hash) (defaults to: {})

    hash of environment variable name-value pairs which should be add

  • jvm_option_sets (Hash) (defaults to: {})

    list of option sets containing JVM options, properties and advanced runtime options

  • jvm_options (Array[String]) (defaults to: [])

    list of options to be passed to the JVM

  • java (Struct[{ properties => Optional[Hash], agents => Optional[Hash], runtime_options => Optional[Hash], adv_runtime_options => Optional[Hash], }]) (defaults to: {})

    input hash to the factory of java properties, agents, runtime_options and advanced_runtime_options

  • java_gc (Optional[Hash]) (defaults to: undef)

    input hash to the java::gc class

  • config (Hash) (defaults to: {})

    configuration hash to be merged with local cassandra.yaml on the node

  • initial_tokens (Optional[Hash[Stdlib::Host,Pattern[/^[0-9]+$/]]]) (defaults to: undef)

    mapping inital token to nodes and merge them into the config

  • node_key (Stdlib::Host) (defaults to: $facts['networking']['fqdn'])

    the key used in initial_tokens to identify nodes

  • cassandra_home (Stdlib::Absolutepath) (defaults to: '/var/lib/cassandra')

    homedirectory of cassandra user

  • envfile (Stdlib::Absolutepath) (defaults to: "${cassandra_home}/.cassandra.in.sh")

    envfile path containing environment settings

  • rackdc (Optional[Cassandra::Rackdc]) (defaults to: undef)

    rack and dc settings to be used by GossipingPropertyFileSnitch

  • topology (Optional[Hash]) (defaults to: undef)

    hash describing the topology to be used by PropertyFileSnitch and GossipingPropertyFileSnitch

  • topology_default (Optional[Pattern[/[a-zA-Z0-9.]:[a-zA-Z0-9.-]/]]) (defaults to: undef)

    default dc and rack settings



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'manifests/init.pp', line 59

class cassandra (
  String                                           $cassandra_package = 'cassandra',
  String                                           $cassandra_ensure = 'installed',
  String                                           $tools_package = 'cassandra-tools',
  String                                           $tools_ensure = $cassandra_ensure,
  Boolean                                          $manage_service = true,
  Cassandra::Service::Ensure                       $service_ensure = undef,
  Cassandra::Service::Enable                       $service_enable = false,
  String                                           $service_name = 'cassandra',
  Stdlib::Absolutepath                             $config_dir = '/etc/cassandra',
  Hash                                             $environment = {},
  Hash                                             $jvm_option_sets = {},
  Array[String]                                    $jvm_options = [],
  Struct[{
      properties          => Optional[Hash],
      agents              => Optional[Hash],
      runtime_options     => Optional[Hash],
      adv_runtime_options => Optional[Hash],
  }]                                               $java = {},
  Optional[Hash]                                   $java_gc = undef,
  Hash                                             $config = {},
  Optional[Hash[Stdlib::Host,Pattern[/^[0-9]+$/]]] $initial_tokens = undef,
  Stdlib::Host                                     $node_key = $facts['networking']['fqdn'],
  Stdlib::Absolutepath                             $cassandra_home = '/var/lib/cassandra',
  Stdlib::Absolutepath                             $envfile = "${cassandra_home}/.cassandra.in.sh",
  Optional[Cassandra::Rackdc]                      $rackdc = undef,
  Optional[Hash]                                   $topology = undef,
  Optional[Pattern[/[a-zA-Z0-9.]:[a-zA-Z0-9.-]/]]  $topology_default  = undef,
) {
  contain cassandra::install
  contain cassandra::config
  contain cassandra::config::topology
  contain cassandra::service

  Class['cassandra::install']
  -> Class['cassandra::config']
  ~> Class['cassandra::service']
  Class['cassandra::install']
  -> Class['cassandra::config::topology']
}