<commit_before># Apache Cassandra Chef Cookbook

[![Build Status](https://travis-ci.org/michaelklishin/cassandra-chef-cookbook.svg?branch=master)](https://travis-ci.org/michaelklishin/cassandra-chef-cookbook)

This is an OpsCode Chef cookbook for Apache Cassandra ([DataStax
Community Edition](http://www.datastax.com/products/community)) as
well as DataStax Enterprise.

It uses officially released packages and provides an Upstart service
script. It has limited support for adjustment of Cassandra
configuration parameters using Chef node attributes.

It was originally created for CI and development environments. More
attributes will be added over time, **feel free to contribute** what
you find missing!


## Supported Apache Cassandra Version

This cookbook currently provides

 * Cassandra 2.x.x via tarball
 * Cassandra 2.x.x or 1.2.x (DataStax Community Edition) via packages.
 * DataStax Enterprise (DSE)

## Supported OS Distributions

 * Ubuntu 11.04 through 14.04 via DataStax apt repo.
 * RHEL/CentOS via DataStax yum repo.
 * RHEL/CentOS/Amazon via tarball

## Support JDK Versions

Cassandra 2.x requires JDK 7+, Oracle JDK is recommended.

## Recipes

Two provided recipes are `cassandra::tarball` and `cassandra::datastax`. The former uses official tarball
and thus can be used to provision any specific version.

The latter uses DataStax repository via packages. You can install different versions (ex. dsc20 for v2.0) available in the repository by altering `:package_name` attribute (`dsc20` by default).

include_recipe `cassandra` uses  `cassandra::datastax` as the default.

### DataStax Enterprise

You can also install the DataStax Enterprise edition by adding `node[:cassandra][:dse]` attributes according to the datastax.rb.

There are also recipes for DataStax opscenter installation ( `opscenter_agent_tarball`, `opscenter_agent_datastax` and `opscenter_server` ) along with attributes available for override (see below).

### JNA Support (Prior C* version 2.1.0)

Attribute `node[:cassandra][:setup_jna]` will install the jna.jar in the
`/usr/share/java/jna.jar`, and create a symbolic link to it on
`#{cassandra.lib\_dir}/jna.jar`, according to the [DataStax
documentation](http://www.datastax.com/documentation/cassandra/1.2/webhelp/cassandra/install/installJnaDeb.html).

## Core Attributes

 * `node[:cassandra][:cluster_name]` (default: none): Name of the cluster to create. This is required.
 * `node[:cassandra][:version]` (default: a recent patch version): version to provision
 * `node[:cassandra][:tarball][:url]` and `node[:cassandra][:tarball][:md5]` specify tarball URL and MD5 check sum used by the `cassandra::tarball` recipe.
  * Setting `node[:cassandra][:tarball][:url]` to "auto" (default) will download the tarball of the specified version from the Apache repository.
 * `node[:cassandra][:setup_user]` (default: true): create user/group for Cassandra node process
 * `node[:cassandra][:user]`: username Cassandra node process will use
 * `node[:cassandra][:group]`: groupname Cassandra node process will use
 * `node[:cassandra][:heap_new_size]` set JVM `-Xmn`; if nil, defaults to `min(100MB * num_cores, 1/4 * heap size)`
 * `node[:cassandra][:max_heap_size]` set JVM `-Xms` and `-Xmx`; if nil, defaults to `max(min(1/2 ram, 1024MB), min(1/4 ram, 8GB))`
 * `node[:cassandra][:installation_dir]` (default: `/usr/local/cassandra`): installation directory
 * `node[:cassandra][:root_dir]` (default: `/var/lib/cassandra`): data directory root
 * `node[:cassandra][:log_dir]` (default: `/var/log/cassandra`): log directory
 * `node[:cassandra][:listen_address]` (default: node[:ipaddress]): address clients will use to connect to the node
 * `node[:cassandra][:broadcast_address]` (default: node IP address): address to broadcast to other Cassandra nodes
 * `node[:cassandra][:rpc_address]` (default: 0.0.0.0): address to bind the RPC interface
 * `node[:cassandra][:seeds]` (default: `[node[:ipaddress]]`): an array of nodes this node will contact to discover cluster topology
 * `node[:cassandra][:notify_restart]` (default: false): notify Cassandra service restart upon resource update<commit_msg>Updated README.md with new usage method and the new attribute description.<commit_after># Apache Cassandra Chef Cookbook

[![Build Status](https://travis-ci.org/michaelklishin/cassandra-chef-cookbook.svg?branch=master)](https://travis-ci.org/michaelklishin/cassandra-chef-cookbook)

This is an OpsCode Chef cookbook for Apache Cassandra ([DataStax
Community Edition](http://www.datastax.com/products/community)) as
well as DataStax Enterprise.

It uses officially released packages and provides an Upstart service
script. It has limited support for adjustment of Cassandra
configuration parameters using Chef node attributes.

It was originally created for CI and development environments. More
attributes will be added over time, **feel free to contribute** what
you find missing!


## Supported Apache Cassandra Version

This cookbook currently provides

 * Cassandra 2.x.x via tarball
 * Cassandra 2.x.x or 1.2.x (DataStax Community Edition) via packages.
 * DataStax Enterprise (DSE)

## Supported OS Distributions

 * Ubuntu 11.04 through 14.04 via DataStax apt repo.
 * RHEL/CentOS via DataStax yum repo.
 * RHEL/CentOS/Amazon via tarball

## Support JDK Versions

Cassandra 2.x requires JDK 7+, Oracle JDK is recommended.

## Recipes

The main recipe is `cassandra::default` which together with the `node[:cassandra][:install_method]` attribute
will be responsible for including the proper installation recipe.

Two actual installation recipes are `cassandra::tarball` and `cassandra::datastax`. The former uses official tarball
and thus can be used to provision any specific version.

The latter uses DataStax repository via packages. You can install different versions (ex. dsc20 for v2.0) available in the repository by altering `:package_name` attribute (`dsc20` by default).

include_recipe `cassandra` uses  `cassandra::datastax` as the default.

### DataStax Enterprise

You can also install the DataStax Enterprise edition by adding `node[:cassandra][:dse]` attributes according to the datastax.rb.

There are also recipes for DataStax opscenter installation ( `opscenter_agent_tarball`, `opscenter_agent_datastax` and `opscenter_server` ) along with attributes available for override (see below).

### JNA Support (Prior C* version 2.1.0)

Attribute `node[:cassandra][:setup_jna]` will install the jna.jar in the
`/usr/share/java/jna.jar`, and create a symbolic link to it on
`#{cassandra.lib\_dir}/jna.jar`, according to the [DataStax
documentation](http://www.datastax.com/documentation/cassandra/1.2/webhelp/cassandra/install/installJnaDeb.html).

## Core Attributes
 * `node[:cassandra][:install_method]` (default: datastax): The installation method to use (either 'datastax' or 'tarball').
 * `node[:cassandra][:cluster_name]` (default: none): Name of the cluster to create. This is required.
 * `node[:cassandra][:version]` (default: a recent patch version): version to provision
 * `node[:cassandra][:tarball][:url]` and `node[:cassandra][:tarball][:md5]` specify tarball URL and MD5 check sum used by the `cassandra::tarball` recipe.
  * Setting `node[:cassandra][:tarball][:url]` to "auto" (default) will download the tarball of the specified version from the Apache repository.
 * `node[:cassandra][:setup_user]` (default: true): create user/group for Cassandra node process
 * `node[:cassandra][:user]`: username Cassandra node process will use
 * `node[:cassandra][:group]`: groupname Cassandra node process will use
 * `node[:cassandra][:heap_new_size]` set JVM `-Xmn`; if nil, defaults to `min(100MB * num_cores, 1/4 * heap size)`
 * `node[:cassandra][:max_heap_size]` set JVM `-Xms` and `-Xmx`; if nil, defaults to `max(min(1/2 ram, 1024MB), min(1/4 ram, 8GB))`
 * `node[:cassandra][:installation_dir]` (default: `/usr/local/cassandra`): installation directory
 * `node[:cassandra][:root_dir]` (default: `/var/lib/cassandra`): data directory root
 * `node[:cassandra][:log_dir]` (default: `/var/log/cassandra`): log directory
 * `node[:cassandra][:listen_address]` (default: node[:ipaddress]): address clients will use to connect to the node
 * `node[:cassandra][:broadcast_address]` (default: node IP address): address to broadcast to other Cassandra nodes
 * `node[:cassandra][:rpc_address]` (default: 0.0.0.0): address to bind the RPC interface
 * `node[:cassandra][:seeds]` (default: `[node[:ipaddress]]`): an array of nodes this node will contact to discover cluster topology
 * `node[:cassandra][:notify_restart]` (default: false): notify Cassandra service restart upon resource update
{'fraction_non_alphanumeric': 0.11821012570637758, 'fraction_numerical': 0.010379425671779494, 'mean_word_length': 5.764430577223089, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5117779', 'n_tokens_mistral': 2762, 'n_tokens_neox': 2647, 'n_words': 908}