Puppet Class: cassandra::config::topology

Defined in:
manifests/config/topology.pp

Summary

Class to manage the cassandra-topology.properties file

Overview

This class manages the cassandra-topology.properties file, which is needed when using PropertyFileSnitch or GossippingPropertyFileSnitch.

This class is contained with config, thus do not use it for its own.

Examples:

multi-dc and multi-rack topology

cassandra::topology:
  dc1:
    rackA:
    - 10.0.0.1
    - 10.0.0.2
    rackB:
    - 10.0.0.3
    - 10.0.0.4
  dc2:
    rackA:
    - 10.0.1.1
    - 10.0.1.2
    rackB:
    - 10.0.1.3
    - 10.0.1.4

setting up topology_default

cassandra::topology:
  dc1:
    rackA:
    - 10.0.0.1
    - 10.0.0.2
    rackB:
    - 10.0.0.3
    - 10.0.0.4
  dc2:
    rackA:
    - 10.0.1.1
    - 10.0.1.2
    rackB:
    - 10.0.1.3
    - 10.0.1.4
cassandra::topology_default: dc1:rackA


43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'manifests/config/topology.pp', line 43

class cassandra::config::topology {
  $path = "${cassandra::config_dir}/cassandra-topology.properties"

  if $cassandra::topology =~ Hash {
    file { $path:
      ensure  => 'file',
      content => epp('cassandra/cassandra-topology.properties.epp'),
    }
  } else {
    file { $path:
      ensure => 'absent',
    }
  }
}