Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x
- Puppet >= 7.0.0 < 9.0.0
- ,
Start using this module
Add this module to your Puppetfile:
mod 'trepasi-cassandra', '6.0.0'
Learn more about managing modules with a PuppetfileDocumentation
cassandra
Project status
Table of Contents
- cassandra
Description
This module enables Puppet to install, configure and run Apache Cassandra nodes. As a spin-off of several years of experience we collected in running Cassandra in a production environment, using Puppet to maintain the configuration of the nodes. During its evolution the module has proven to be useful for Cassandra versions ranging from early 1.1, over many 2.x, 3.0, 3.11 to latest 5.0 releases and multiple distributions, e.g. DSE, Apache and other. Efforts are taken to keep the generally available Apache open-source releases supported.
Leveraging the declarative nature of Puppet DSL, Cassandra configuration is considered a declarative description of the desired state and will be ensured in the node configuration. Configuration values not declared in the manifest will be kept untouched by this module.
Conceptualized to fit into a roles/profiles design pattern, this module keeps a strong focus on the topic of Cassandra node configuration disregarding many aspects bound to the use-case and the infrastructure environment.
Setup
What cassandra affects
This module affects the following component:
- Install the Packages
cassandra
andcassandra-tools
. - It takes control over the file
.cassandra.in.sh
located in Cassandra user's home directory. - It takes control over
cassandra-rackdc.properties
andcassandra-topology.properties
- Optionally it can take control over the
jvm.options
file and its successors for multiple Java versions and variants, used to configure Java parameters. - It manages the content of the
cassandra.yaml
by merging a configuration hash to the file as it is found on the node, i.e. installed from the package.
A bit more important to know is that it does not control the contents of cassandra-env.sh
and many other files, which might lead to conflicts during package updates.
Setup Requirements
Installation and running of Cassandra will require some other settings not covered by this module, e.g.:
- access to a package repository providing the necessery packages for your operating system distribution
- installation of a suitable Java runtime environment
- setup of a proper clock synchronisation, e.g. NTP
- configuration of additional settings, e.g. kernel parameter, firewall, etc.
Beginning with cassandra
Include the module to your node manifests (or your role or profile module):
contain cassandra
Usage
Once included in the node manifest the module can be configured via Hiera.
Installation versions
By default the latest available version of cassandra
and cassandra-tools
packages will be installed. The default settings will prevent autoatic upgrades.
If you want Puppet to install a specific version, e.g. 4.0.0, just add the following parameter to your Hiera DB:
cassandra::cassandra_ensure: 4.0.0
The version ensurement of the tools package defaults to cassandra::cassandra_ensure
but can be set differently, e.g.:
cassandra::tools_ensure: latest
If you don't want to install the tools package, you can set:
cassandra::tools_ensure: absent
In the case, your package name differs from default Apache releases you may change cassandra_package
and/or tools_package
settings, e.g.
cassandra::cassandra_package: dsc22
Main node configuration
The module provides you access to the main configuration file, the cassandra.yaml
, through the configuration parameter config
. This may contain a hash resembling the structure of the cassandra.yaml
, which will be merged to the current content of the cassandra.yaml
file on the node. This merge will only happen on the node itself.
Thus the config
parameter should contain only those settings you want to have non-default, i.e. want to change on the node. Keep in mind, that the structure of this hash must fit to the structure of cassandra.yaml
, e.g.
cassandra::config:
cluster_name: Example Cassandra cluster
endpoint_snitch: PropertyFileSnitch
seed_provider:
- class_name: org.apache.cassandra.locator.SimpleSeedProvider
parameters:
- seeds: 10.0.0.1,10.0.1.1
listen_address: "%{facts.networking.ip}"
As seen for listen_address
in the example, you can use Hiera interpolation to access Facts to setup the Cassandra node.
For deeper understanding of this merge procedure refer to the cataphract/yaml_settings module, which is used to merge the config
hash with the cassandra.yaml
on the node.
Setting up initial_token
If your Cassandra setup relies on the setting of initial_token
within cassandra.yaml
, the module is providing a sophisticated feature. You may set the initial_tokens
parameter containing a hash mapping the initial token for each node by a node key. The module will lookup the initial_token for each node by the configured node_key
and set the initial_token
within the config hash. If there is no entry for a node found, an error is raised which stops the Puppet agent on that node. Example:
cassandra::initial_tokens:
node01.server.lan: '0'
node02.server.lan: '56713727820156410577229101238628035242'
node03.server.lan: '113427455640312821154458202477256070484'
The node_key
parameter, which defaults to $facts['networking']['fqdn']
can be changed if you want to map the initial_token by some other ID.
Rack and DC settings
When using GossipingPropertyFileSnitch
class for endpoint snitch your cluster, you can manage the cassandra-rackdc.properties
file through the rackdc
parameter of this module.
cassandra::rackdc:
dc: dc1
rack: rackA
Optionally parameters prefer_local
and dc_suffix
are also accepted in the rackdc
hash.
Topology settings
Using enpoint snitch classes PropertyFileSnitch
or GossipingPropertyFileSnitch
, you might want to control the contents of cassandra-topology.properties
file. This is enabled through the topology
parameter of this module. Containing a multi-leveld hash mapping arrays of your nodes to the racks and the racks to the datacenters. For example:
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
This will end up in a cassandra-topology.properties
file containing:
10.0.0.1=dc1:rackA
10.0.0.2=dc1:rackA
10.0.0.3=dc1:rackB
10.0.0.4=dc1:rackB
10.0.1.1=dc2:rackA
10.0.1.2=dc2:rackA
10.0.1.3=dc2:rackB
10.0.1.4=dc2:rackB
Note #1: leaving the topology
parameter undef
(which is default), the module will remove the cassandra-topology.properties
file from your nodes. This is intended behaviour to support the migration from PropertyFileSnitch
to GossipingPropertyFileSnitch
.
Note #2: while many configuration changes will notify the service to restart, this is suppressed in the module on updates to the cassandra-topology.properties
file. Changes made to the topology won't bump the Cassandra node, because both snitch classes using this file are reloading it in runtime to read its updated content.
Setting the runtime environment
The module provides a variety of settings to runtime environment and the Java VM.
Environment variables
The defined type cassandra::environment::variable
can be used to created variables in the Cassandra process's environment. These typically contain MAX_HEAP_SIZE
, HEAP_NEWSIZE
, JAVA_HOME
, LOCAL_JMX
and other Cassandra specific variables.
Using the environment
parameter will create cassandra::environment::variable
instances, e.g.:
cassandra::environment:
MAX_HEAP_SIZE: 8G
HEAP_NEWSIZE: 2G
JVM options
The defined type cassandra::environment::jvm_option
add options to the JVM Cassandra is running on.
Using the jvm_options
parameter will create instances of cassandra::environment::jvm_option
, e.g.:
cassandra::jvm_options:
- verbose:gc
- server
Java runtime settings
Within the cassandra::java
namespace there are components allowing to setup:
- Java agents through defined type
cassandra::java::agent
- Properties through defined type
cassandra::java::property
- runtime options through defined type
cassandra::java::runtimeoption
- advanced runtime options through defined type
cassandra::java::advancedruntimeoption
- garbage collector settings through class
cassandra::java::gc
Using the java
property will create instances of the above. E.g.:
cassandra::java:
properties:
cassandra.consistent.rangemovement: false
cassandra.replace_address: 10.0.0.2
agents:
jmx_prometheus_javaagent.jar: 8080:config.yaml
runtime_options:
check: jni
adv_runtime_options:
LargePageSizeInBytes: 2m
UseLargePages: true
AlwaysPreTouch: true
Java garbage collection settings
Deprication notice: cassandra::java_gc
and the class cassandra::java::gc
are now deprecated. Consider using JVM option sets instead.
Settings to Java garbage collector can be made by instanciating the cassandra::java::gc
class. Using the java_gc
parameter will instantiate the class, e.g.:
cassandra::java_gc:
collector: g1
params:
maxGCPauseMillis: 300
JVM option sets
Since version 2.2 the module is supporting a novel approach to setup options of Cassandra Java runtime. The JVM option set feature is controlling the jvm.options
file of Cassandra 3.x and many combinations used for different Java versions and use case scopes by Cassandra 4.0 and later.
Note, that much of these settings will override settings done with cassandra::java
and all of this will collide with cassandra::java_gc
if set. Thus remove cassandra::java_gc
at all when starting with cassandra::jvm_option_sets
and consider migrating cassandra::java
settings to cassandra::jvm_options
.
JVM options for Cassandra 3.x
Default behaviour will control the jvm.options
file. The defined type cassandra::jvm_option_set
resource take parameters options
, sizeoptions
, properties
and advancedoptions
and add the settings to the jvm.options
file.
Use the cassandra::jvm_option_sets
parameter to build instances of cassandra::jvm_option_set
type. For example:
cassandra::jvm_option_sets:
example:
options:
- ea
- server
sizeoptions:
Xms: 4G
Xmx: 4G
Xmn: 800M
advancedoptions:
LargePageSizeInBytes: 2m
UseLargePages: true
AlwaysPreTouch: true
properties:
cassandra.start_rpc: false
For all options, advanced runtime options and properties in the above example, the Puppet module will take control over the according lines in the jvm.options
file only and set the desired options. Many other settings within jvm.options
will not be touched by Puppet.
The top level ID (example
) is the name of the option set allowing the grouping of options. Multiple option sets are allowed, however, it is not allowed to set the same option within different option sets.
In order to enable the removal of specific settings from jvm.options
, use a tilde ~
to prefix options, and undef value (denoted with tilde ~
in Hiera) of properties
, sizeoptions
and advancedoptions
. The example below show how to remove specific settings.
cassandra::jvm_option_sets:
remove:
options:
- ~ea
sizeoptions:
Xmn: ~
advancedoptions:
FlightRecorder: ~
properties:
cassandra.initial_token: ~
Cassandra 4.0 and later JVM setup
Cassandra 4.0 and later are using distinct option files for server operation and client tools, for Java version independent options and for different Java versions. Set the parameters optsfile
to jvm
, jvm8
, jvm11
or jvm17
and variant
to server
or clients
accordingly.
cassandra::jvm_option_sets:
java8example:
optsfile: jvm8
variant: server
advancedoptions:
ThreadPriorityPolicy: 42
java11example:
optsfile: jvm11
variant: server
advancedoptions:
UseConcMarkSweepGC: false
CMSParallelRemarkEnabled: ~
UnlockExperimentalVMOptions: true
UseZGC: true
Reference
Automatically generated reference documentation is available in the REFERENCE.md file or at https://rtib.github.io/puppet-cassandra/.
Limitations
For supported operating systems and dependencies, see metadata.json.
Extensive itegration tests are run nightly to assure quality and compatibility with next releases.
The current integration test matrix:
Cassandra branch | OS distro | JDK1 |
---|---|---|
3.0 | Debian:9Ubuntu:16.04Ubuntu:18.04 | OpenJDK-8 |
3.11 | Debian:9Ubuntu:16.04Ubuntu:18.04 | OpenJDK-8 |
4.0 | Debian:9Debian:10Ubuntu:16.04Ubuntu:18.04 | OpenJDK-8OpenJDK-11OpenJDK-8OpenJDK-8 |
1: Note, that this module will not manage any JDK installation. The JDK versions listed here are automatically installed via dependencies while the module is installing the latest available Cassandra version from the release branch.
Development
The module is developed using recent Puppet Development Kit, validated and extensively tested using Puppet Litmus. Automated workflows, implemented with GitHub Actions are run on demand and nightly, doing validation, spec tests and continuous integration tests.
As an open project, you are welcome to contribute to this module. Currently, there is no contribution guide specific to this module, general information about the workflow may apply. In case of questions feel free to open a issue or join community Slack channels #forge-modules, #puppet, #puppet-dev, #testing on slack.puppet.com.
Issues and pull requests will be addressed in a timely manner, according to community best practice. Releases are going to be published on demand, after having merged an set of sufficiently important changes and all tests succeeded. There may be automated rule enforcement in place to provide a healthy issue lifecycle.
Reference
Table of Contents
Classes
cassandra
: This is the main entry point and API for Cassandra module.cassandra::config
: Manages the configuration files on your Cassandra nodescassandra::config::rackdc
: Class to manage thecassandra-rackdc.properties
filecassandra::config::topology
: Class to manage the cassandra-topology.properties filecassandra::install
: Installs the Cassandra packages.cassandra::java::gc
: Setup the Java garbage collection for Cassandracassandra::reaper
: Manage a cassandra-reaper instancecassandra::reaper::config
: Do not include this class for its own.cassandra::reaper::install
: Do not include this class for its own.cassandra::reaper::service
: Do not include this class for its own.cassandra::service
: Controls the service
Defined types
cassandra::environment::jvm_option
: Creates a JVM option for Cassandra.cassandra::environment::variable
: Creating an environment variable for Cassandra.cassandra::java::advancedruntimeoption
: Add an advanced runtime option to the JVM running Cassandra.cassandra::java::agent
: Add an agent to the JVM running Cassandra.cassandra::java::property
: Add a Java property to the JVM running Cassandra.cassandra::java::runtimeoption
: Add a runtime option to the JVM running Cassandra.cassandra::jvm_option_set
: Set JVM options by controlling particular lines of jvm.options file.
Data types
Cassandra::Rackdc
: Hash allowing to setup the content ofcassandra-rackdc.properties
. Note, that the fieldsdc
andrack
mandatory to setup rackdc, while `Cassandra::Service::Enable
: Service enable can bemanual
ormask
besides the Boolean.Cassandra::Service::Ensure
: This type is simply missing from Stdlib.
Classes
cassandra
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
The following parameters are available in the cassandra
class:
cassandra_package
cassandra_ensure
tools_package
tools_ensure
manage_service
service_ensure
service_enable
service_name
config_dir
environment
jvm_option_sets
jvm_options
java
java_gc
config
initial_tokens
node_key
cassandra_home
envfile
rackdc
topology
topology_default
cassandra_package
Data type: String
name of the package to be installed
Default value: 'cassandra'
cassandra_ensure
Data type: String
ensure clause for cassandra package
Default value: 'installed'
tools_package
Data type: String
package name of cassandra tools
Default value: 'cassandra-tools'
tools_ensure
Data type: String
ensure clause for tools package
Default value: $cassandra_ensure
manage_service
Data type: Boolean
enables puppet to manage the service
Default value: true
service_ensure
Data type: Cassandra::Service::Ensure
ensure clause for cassandra service
Default value: undef
service_enable
Data type: Cassandra::Service::Enable
enable state of cassandra service
Default value: false
service_name
Data type: String
the name of the cassandra service
Default value: 'cassandra'
config_dir
Data type: Stdlib::Absolutepath
cassandra configuration directory
Default value: '/etc/cassandra'
environment
Data type: Hash
hash of environment variable name-value pairs which should be add
Default value: {}
jvm_option_sets
Data type: Hash
list of option sets containing JVM options, properties and advanced runtime options
Default value: {}
jvm_options
Data type: Array[String]
list of options to be passed to the JVM
Default value: []
java
Data type: Struct[{ properties => Optional[Hash], agents => Optional[Hash], runtime_options => Optional[Hash], adv_runtime_options => Optional[Hash], }]
input hash to the factory of java properties, agents, runtime_options and advanced_runtime_options
Default value: {}
java_gc
Data type: Optional[Hash]
input hash to the java::gc
class
Default value: undef
config
Data type: Hash
configuration hash to be merged with local cassandra.yaml on the node
Default value: {}
initial_tokens
Data type: Optional[Hash[Stdlib::Host,Pattern[/^[0-9]+$/]]]
mapping inital token to nodes and merge them into the config
Default value: undef
node_key
Data type: Stdlib::Host
the key used in initial_tokens to identify nodes
Default value: $facts['networking']['fqdn']
cassandra_home
Data type: Stdlib::Absolutepath
homedirectory of cassandra user
Default value: '/var/lib/cassandra'
envfile
Data type: Stdlib::Absolutepath
envfile path containing environment settings
Default value: "${cassandra_home}/.cassandra.in.sh"
rackdc
Data type: Optional[Cassandra::Rackdc]
rack and dc settings to be used by GossipingPropertyFileSnitch
Default value: undef
topology
Data type: Optional[Hash]
hash describing the topology to be used by PropertyFileSnitch and GossipingPropertyFileSnitch
Default value: undef
topology_default
Data type: Optional[Pattern[/[a-zA-Z0-9.]:[a-zA-Z0-9.-]/]]
default dc and rack settings
Default value: undef
cassandra::config
This class is managing the following files:
- /var/lib/cassandra/.cassandra.in.sh
- /etc/cassandra/cassandra-rackdc.properties
- /etc/cassandra/cassandra.yaml
- /etc/cassandra/jvm.options
The main class of this module will include this class, you should not invoke this at all.
All parameter necessery for this class are defined in the main class.
The config
parameter should contain only those settings you want
to have non-default, i.e. want to change on the node. Keep in mind,
that the structure of this hash must fit to the structure of
cassandra.yaml
.
Examples
main config file handling
cassandra::config:
cluster_name: Example Cassandra cluster
endpoint_snitch: PropertyFileSnitch
seed_provider:
- class_name: org.apache.cassandra.locator.SimpleSeedProvider
parameters:
- seeds: 10.0.0.1,10.0.1.1
listen_address: "%{facts.networking.ip}"
cassandra::config::rackdc
This class manages the cassandra-rackdc.properties file, which is needed when using GossippingPropertyFileSnitch.
This class is contained with config, thus do not use it for its own.
Examples
simple rack and DC settings
cassandra::rackdc:
dc: dc1
rack: rackA
rack, DC and dc_suffix settings
cassandra::rackdc:
dc: dc1
rack: rackA
dc_suffix: .example.org
cassandra::config::topology
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
cassandra::install
This class is installing the Cassandra and optionally the Tools packages.
The main class of this module will include this class, you should not invoke this at all.
All parameter necessery for this class are defined in the main class.
Examples
install a specific version
cassandra::cassandra_ensure: 3.0.18
to install the latest version of cassandra-tools, independently from the cassandra version above
cassandra::tools_ensure: latest
if you don't want to install the tools package
cassandra::tools_ensure: absent
in the case, your package name is other
cassandra::cassandra_package: dsc22
cassandra::java::gc
Deprication notice: this class is now deprecated. Consider using JVM option sets instead.
This class allows to set consistent JVM options at once, especially for the purpose of garbage collection settings. This is enabled by managing jvm.options file, available from Cassandra version 3.0 and later.
GC parameters could be:
- common parameters
- numberOfGCLogFiles (Integer, defaults to: 10) - -XX:NumberOfGCLogFiles
- gCLogFileSize (String, defaults to: 10M) - -XX:GCLogFileSize
- G1 specific parameters
- maxGCPauseMillis (Integer, defaults to: 500) - -XX:MaxGCPauseMillis
- g1RSetUpdatingPauseTimePercent (Integer, defaults to: 5) - -XX:G1RSetUpdatingPauseTimePercent
- initiatingHeapOccupancyPercent (Integer, defaults to: 70) - -XX:InitiatingHeapOccupancyPercent
- parallelGCThreads (Optional[Integer], defaults to: undef) - -XX:ParallelGCThreads automatically set to number or cores-2 if >10 cores present
- concGCThreads (Optional[Integer], defaults to: undef) - -XX:ConcGCThreads automatically set to -XX:ParallelGCThreads if the above is set
The config
class contains a factory for this class which will create
an instance using the settings of cassandra::java_gc
, if not undef.
Examples
directly created
class { 'cassandra::java::gc':
collector => 'g1',
}
factory generated
cassandra::java_gc:
collector: g1
params:
maxGCPauseMillis: 300
Parameters
The following parameters are available in the cassandra::java::gc
class:
collector
Data type: Enum['cms','g1']
select the garbage collector to use
params
Data type: Hash[String,Data]
parameter to set up the selected GC
Default value: {}
cassandra::reaper
This class is installing and managing an instance of cassandra-repear.
Examples
include cassandra::reaper
Parameters
The following parameters are available in the cassandra::reaper
class:
package_ensure
Data type: String
package state to be ensured
Default value: 'latest'
template
Data type: Optional[String]
select the configuration template to which the settings are going to be merged
Default value: undef
settings
Data type: Hash
hash of cassandra-reaper settings to be merged
Default value: {}
configdir
Data type: Stdlib::Absolutepath
directory where to place the configuration file
Default value: '/etc/cassandra-reaper'
templatedir
Data type: Stdlib::Absolutepath
directory containing the template configurations
Default value: "${configdir}/configs"
service_ensure
Data type: Cassandra::Service::Ensure
serivce state to be ensured
Default value: 'running'
service_enable
Data type: Cassandra::Service::Enable
whether to enable or disable the service
Default value: true
cassandra::reaper::config
Managing the configuration of a cassandra reaper instance.
This class is included by cassandra::reaper and should not be used otherwise.
cassandra::reaper::install
Installing a cassandra reaper instance.
This class is included by cassandra::reaper and should not be used otherwise.
cassandra::reaper::service
Managing the service of a cassandra reaper instance.
This class is included by cassandra::reaper and should not be used otherwise.
cassandra::service
This class is controlling the Cassandra service on the nodes. Take care of the fact, that configuration changes will notify the service which may lead to onorchestrated node restarts on your cluster.
You probably don't want this happen in production.
Defined types
cassandra::environment::jvm_option
Each instance of this type is adding a JVM option to
the JVM running the Cassandra. This enables you to set e.g.
verbose:gc
.
The config
class contains a factory for this type which will create
instances for each key of cassandra::jvm_options
.
Examples
directly created
cassandra::jvm_option { 'verbose:gc': }
factory generated
cassandra::jvm_options:
- verbose:gc
- server
cassandra::environment::variable
Each instance of this type is adding a environment variable to
the Cassandra process. This enables you to set e.g. MAX_HEAP_SIZE
,
HEAP_NEWSIZE
, etc.
The config
class contains a factory for this type which will create
instances for each key of cassandra::environment
.
Examples
directly created
cassandra::environment::variable { 'MAX_HEAP_SIZE':
value => '8G',
}
factory generated
cassandra::environment:
MAX_HEAP_SIZE: 8G
HEAP_NEWSIZE: 2G
Parameters
The following parameters are available in the cassandra::environment::variable
defined type:
id
Data type: String
name of the environment variable
Default value: $title
value
Data type: String
value to be assigned to the variable
cassandra::java::advancedruntimeoption
Each instance of this type adds a advanced runtime option to the JVM running Cassandra.
The config
class contains a factory for this type which will
create instances for each key of cassandra::java::runtime_options
.
Examples
directly created
cassandra::java::advancedruntimeoption { 'LargePageSizeInBytes':
value => '2m',
}
factory generated
cassandra::java:
adv_runtime_options:
LargePageSizeInBytes: 2m
UseLargePages: true
AlwaysPreTouch: true
Parameters
The following parameters are available in the cassandra::java::advancedruntimeoption
defined type:
value
Data type: Scalar
a string value to be added to the runtime option or a boolean which will prefix the option with + or -
cassandra::java::agent
Each instance of this type adds an agent to the JVM running Cassandra.
The config
class contains a factory for this type which will
create instances for each key of cassandra::java::agents
.
Examples
directly created
cassandra::java::agent { 'jmx_prometheus_javaagent.jar':
value => '8080:config.yaml',
}
factory created
cassandra::java:
agents:
jmx_prometheus_javaagent.jar: 8080:config.yaml
Parameters
The following parameters are available in the cassandra::java::agent
defined type:
value
Data type: Optional[String]
options to be added to the agent
Default value: undef
cassandra::java::property
Each instance of this type adds a property to the JVM running Cassandra.
The config
class contains a factory for this type which will
create instances for each key of cassandra::java::properties
.
Examples
directly created
cassandra::java::property { 'cassandra.replace_address':
value => '10.0.0.2'
}
factory generated
cassandra::java:
properties:
cassandra.consistent.rangemovement: false
cassandra.replace_address: 10.0.0.2
Parameters
The following parameters are available in the cassandra::java::property
defined type:
value
Data type: Scalar
the value the property is set to
cassandra::java::runtimeoption
Each instance of this type adds a runtime option to the JVM running Cassandra.
The config
class contains a factory for this type which will
create instances for each key of cassandra::java::runtime_options
.
Examples
directly created
cassandra::java::runtimeoption { 'prof': }
factory generated
cassandra::java:
runtime_options:
check: jni
prof:
Parameters
The following parameters are available in the cassandra::java::runtimeoption
defined type:
value
Data type: Optional[Scalar]
value to be added to the runtime option
Default value: undef
cassandra::jvm_option_set
Select the file to be controlled by choosing, jvm, jvm8 or jvm11 and the variant server or clients. Options, properties and advanced runtime options can be defined to have particular values or to be removed from the configuration. Any option not mentioned will not be touched.
For Cassandra 3.x versions, only optsfile = jvm
with variant = undef
is supported,
which will control the /etc/cassandra/jvm.options
file. Since Cassandra versions >= 4.0
use distinct option files for server and clients, as well as Java independent, Java-8 and
Java-11, use parameters optsfile
and variant
to select a particular options file.
Parameters
The following parameters are available in the cassandra::jvm_option_set
defined type:
optsfile
Data type: Enum['jvm', 'jvm8', 'jvm11']
determine the file to control, either jvm
for the independet
options or jvm8
or jvm11
for the version dependant options
Default value: 'jvm'
variant
Data type: Optional[Enum['clients', 'server']]
leave this undef for Cassandra < 4.0, set it to server
or clients
if running >= 4.0
Default value: undef
options
Data type: Array[String]
list of basic JVM options, e.g. ea
, server
, Xms4g
, etc.
Default value: []
properties
Data type: Hash[String,Optional[Scalar]]
java properties to be passed to the JVM
Default value: {}
sizeoptions
Data type: Hash[String,Optional[Scalar]]
JVM options having a value concatenated directly to the options, e.g. Xmx4g
.
Default value: {}
advancedoptions
Data type: Hash[String,Optional[Scalar]]
advanced runtime options which may be feature toggles or values
Default value: {}
Data types
Cassandra::Rackdc
Hash allowing to setup the content of cassandra-rackdc.properties
.
Note, that the fields dc
and rack
mandatory to setup rackdc, while
dc_suffix
and prefer_local
can be set optionally.
Alias of
Struct[{
dc => String,
rack => String,
dc_suffix => Optional[String],
prefer_local => Optional[Boolean],
}]
Cassandra::Service::Enable
Service enable can be manual
or mask
besides the Boolean.
Alias of
Variant[Boolean, Enum['manual','mask']]
Cassandra::Service::Ensure
This type is simply missing from Stdlib.
Alias of
Optional[Variant[Boolean,Enum['stopped', 'running']]]
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
v6.0.0 - 2024-10-23
Changed
Added
v5.0.2 - 2023-06-28
Fixed
- adopt stdlib-9 #39 (rtib)
- [MODULES-11117] enforce documentation template conformance to meet requirements #37 (rtib)
- update stdlib dependency version limit #35 (rtib)
v5.0.1 - 2021-08-05
Fixed
v5.0.0 - 2021-06-28
Changed
- review requirement and dependencies, version cut #32 (rtib)
- change default value service enable #31 (rtib)
v4.0.0 - 2021-05-28
Changed
v3.1.0 - 2021-03-03
Added
Fixed
v3.0.0 - 2021-03-02
Changed
Fixed
v2.3.0 - 2020-07-20
Added
Fixed
v2.2.1 - 2020-07-14
Fixed
v2.2.0 - 2020-07-13
Added
Fixed
v2.1.2 - 2020-02-07
Added
v2.1.1 - 2019-07-22
Fixed
v2.1.0 - 2019-07-19
Added
Fixed
v2.0.1 - 2019-07-18
Dependencies
- puppetlabs/stdlib (>= 7.0.0 < 10.0.0)
- puppetlabs/concat (>= 7.0.0 < 10.0.0)
- cataphract/yaml_settings (>=0.1.0 < 1.0.0)
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.