- Overview
- Setup - The basics of getting started with cassandra
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Contributers
A Puppet module to install and manage Cassandra and DataStax Agent.
- Installs the Cassandra package (default dsc21).
- Configures settings in ${config_path}/cassandra.yaml.
- Optionally ensures that the Cassandra service is enabled and running.
- Optionally configures a Yum repository to install the Cassandra packages from (on Red Hat).
- Optionally configures an Apt repository to install the Cassandra packages from (on Ubuntu).
- Optionally installs the DataStax agent.
- Optionally installs a JRE/JDK package (e.g. java-1.7.0-openjdk).
- Optionally installs the Cassandra support tools (e.g. cassandra21-tools).
This most basic example would attempt to install the default Cassandra package (assuming there is an available repository). See the Usage(#usage) section for more realistic scenarios.
node 'example' {
include '::cassandra'
}
To install the DataStax agent, include the specific class.
node 'example' {
include '::cassandra'
include '::cassandra::datastax_agent'
}
To install with a reasonably sensible Java environment include the java subclass.
node 'example' {
include '::cassandra'
include '::cassandra::java'
}
To install Cassandra with the optional utilities.
node 'example' {
include '::cassandra'
include '::cassandra::optutils'
}
To install the main cassandra package (which is mandatory) and all the optional packages, do the following:
node 'example' {
include '::cassandra'
include '::cassandra::datastax_agent'
include '::cassandra::java'
include '::cassandra::optutils'
}
By saying the cassandra class/package is mandatory, what is meant is that all the sub classes have a dependency on the main class. So for example one could not specify the cassandra::java class for a node with the cassandra class also being included.
The following changes to the API have taken place.
There is now a cassandra::datastax_agent class, therefore:
- cassandra::datastax_agent_package_ensure has now been replaced with cassandra::datastax_agent::package_ensure.
- cassandra::datastax_agent_service_enable has now been replaced with cassandra::datastax_agent::service_enable.
- cassandra::datastax_agent_service_ensure has now been replaced with cassandra::datastax_agent::service_ensure.
- cassandra::datastax_agent_package_name has now been replaced with cassandra::datastax_agent::package_name.
- cassandra::datastax_agent_service_name has now been replaced with cassandra::datastax_agent::service_name.
Likewise now there is a new class for handling the installation of Java:
- cassandra::java_package_ensure has now been replaced with cassandra::java::ensure.
- cassandra::java_package_name has now been replaced with cassandra::java::package_name.
Also there is now a class for installing the optional utilities:
- cassandra::cassandra_opt_package_ensure has now been replaced with cassandra::optutils:ensure.
- cassandra::cassandra_opt_package_name has now been replaced with cassandra::optutils:package_name.
-
cassandra_opt_package_ensure changed from 'present' to undef.
-
The manage_service option has been replaced with service_enable and service_ensure.
To install Cassandra in a two node cluster called 'Foobar Cluster' where node1 (192.168.42.1) is the seed and node2 (192.168.42.2) is also to be a member, do something similar to this:
include cassandra::java
include cassandra::optutils
node 'node1' {
class { 'cassandra':
cluster_name => 'Foobar Cluster',
listen_address => "${::ipaddress}",
seeds => "${::ipaddress}",
manage_dsc_repo => true
}
}
node 'node2' {
class { 'cassandra':
cluster_name => 'Foobar Cluster',
listen_address => "${::ipaddress}",
seeds => '192.168.42.1',
manage_dsc_repo => true
}
}
This would also ensure that the JDK is installed and the optional Cassandra tools.
- cassandra
- cassandra::datastax_agent
- cassandra::java
- cassandra::optutils
A class for installing the Cassandra package and manipulate settings in the configuration file.
This is passed to the cassandra.yaml file (default AllowAllAuthenticator).
This is passed to the cassandra.yaml file (default: AllowAllAuthorizer).
This is passed to the cassandra.yaml file (default true).
The status of the package specified in cassandra_package_name. Can be present, latest or a specific version number (default present).
The name of the Cassandra package. Must be available from a repository (default dsc21).
The path to the Puppet template for the Cassandra configuration file. This allows the user to supply their own customized template. A Cassandra 1.X compatible template called cassandra1.yaml.erb has been provided by @Spredzy (default cassandra/cassandra.yaml.erb).
This is passed to the cassandra.yaml file (default false).
This is passed to the cassandra.yaml file (default conf/.keystore).
This is passed to the cassandra.yaml file (default cassandra).
This is passed to the cassandra.yaml file (default Test Cluster).
This is passed to the cassandra.yaml file (default /var/lib/cassandra/commitlog).
This is passed to the cassandra.yaml file (default 32).
This is passed to the cassandra.yaml file (default 32).
This is passed to the cassandra.yaml file (default 32).
The path to the cassandra configuration file. If this is undef, it will be changed to /etc/cassandra/default.conf on the Red Hat family of operating systems or /etc/cassandra on Ubuntu. Otherwise the user can specify the path name (default undef).
This is passed to the cassandra.yaml file (default ['/var/lib/cassandra/data']).
This is passed to the cassandra.yaml file (default: stop).
This is passed to the cassandra.yaml file (default: SimpleSnitch).
This is passed to the cassandra.yaml file (defaults to 'true').
This is passed to the cassandra.yaml file (default false).
This is passed to the cassandra.yaml file (default all).
This is passed to the cassandra.yaml file (default localhost).
If set to true then a repository will be setup so that packages can be downloaded from the DataStax community edition (default false).
This is passed to the cassandra.yaml file (default 9042).
This is passed to the cassandra.yaml file (default 256).
This is passed to the cassandra.yaml file (default org.apache.cassandra.dht.Murmur3Partitioner)
This is passed to the cassandra.yaml file (default localhost).
This is passed to the cassandra.yaml file (default 9160).
This is passed to the cassandra.yaml file (default sync).
This is passed to the cassandra.yaml file (default /var/lib/cassandra/saved_caches).
This is passed to the cassandra.yaml file (default 127.0.0.1).
This is passed to the cassandra.yaml file (default none).
This is passed to the cassandra.yaml file (default conf/.keystore).
This is passed to the cassandra.yaml file (default cassandra).
This is passed to the cassandra.yaml file (default conf/.truststore).
This is passed to the cassandra.yaml file (default cassandra).
Enable the Cassandra service to start at boot time. Valid values are true or false (default: true)
Ensure the Cassandra service is running. Valid values are running or stopped (default: running)
The name of the service that runs the Cassandra software (default cassandra).
This is passed to the cassandra.yaml file (default false).
This is passed to the cassandra.yaml file (default true).
This is passed to the cassandra.yaml file (default true).
This is passed to the cassandra.yaml file (default 7000).
A class for installing the DataStax agent and to point it at an Opscenter instance.
Is passed to the package reference. Valid values are present or a version number (default present).
Is passed to the package reference (default datastax-agent).
Is passed to the service reference (default running).
Is passed to the service reference (default true).
Is passed to the service reference (default datastax-agent).
If the value is changed from the default of undef then this is what is set as the stomp_interface setting in /var/lib/datastax-agent/conf/address.yaml which connects the agent to an Opscenter instance (default undef).
A class to install a reasonably sensible Java package.
Is passed to the package reference. Valid values are present or a version number (default present).
If the default value of undef is left as it is, then a package called java-1.8.0-openjdk-headless or openjdk-7-jre-headless will be installed on a Red Hat family or Ubuntu system respectively. Alternatively, one can specify a package that is available in a package repository to the node (default undef).
A class to install the optional Cassandra tools package.
Is passed to the package reference. Valid values are present or a version number (default present).
If the default value of undef is left as it is, then a package called cassandra21-tools or cassandra-tools will be installed on a Red Hat family or Ubuntu system respectively. Alternatively, one can specify a package that is available in a package repository to the node (default undef).
Tested on the Red Hat family versions 6 and 7, Ubuntu 12.04 and 14.04, Puppet (CE) 3.7.5 and DSC 2.1.
Contributions will be gratefully accepted. Please go to the project page, fork the project, make your changes locally and then raise a pull request. Details on how to do this are available at https://guides.github.com/activities/contributing-to-open-source.
-
Yanis Guenane (GitHub @spredzy) provided the Cassandra 1.x compatible template (see #11).
-
Amos Shapira (GitHub @amosshapira) fixed a bug in the requirements metadata that caused a problem with Puppetfile (see #34).