diff --git a/docs/_index.html b/docs/_index.html new file mode 100644 index 0000000..dc32417 --- /dev/null +++ b/docs/_index.html @@ -0,0 +1,229 @@ + + + + + + + Documentation by YARD 0.9.10 + + + + + + + + + + + + + + + + + + + +
+ + +

Documentation by YARD 0.9.10

+
+

Alphabetic Index

+ +

Puppet Class Listing A-Z

+ + + + + + +
+ + + + +
+ + +

Defined Type Listing A-Z

+ + + + + + +
+ + + + +
+ + + + + +

File Listing

+ + +
+ + +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/css/common.css b/docs/css/common.css new file mode 100644 index 0000000..d28b093 --- /dev/null +++ b/docs/css/common.css @@ -0,0 +1,8 @@ +/* Ensure the search bar doesn't overlap with links */ +.fixed_header { + padding-bottom: 25px; +} + +#full_list { + padding-top: 15px; +} diff --git a/docs/css/full_list.css b/docs/css/full_list.css new file mode 100644 index 0000000..fa35982 --- /dev/null +++ b/docs/css/full_list.css @@ -0,0 +1,58 @@ +body { + margin: 0; + font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; + font-size: 13px; + height: 101%; + overflow-x: hidden; + background: #fafafa; +} + +h1 { padding: 12px 10px; padding-bottom: 0; margin: 0; font-size: 1.4em; } +.clear { clear: both; } +.fixed_header { position: fixed; background: #fff; width: 100%; padding-bottom: 10px; margin-top: 0; top: 0; z-index: 9999; height: 70px; } +#search { position: absolute; right: 5px; top: 9px; padding-left: 24px; } +#content.insearch #search, #content.insearch #noresults { background: url(data:image/gif;base64,R0lGODlhEAAQAPYAAP///wAAAPr6+pKSkoiIiO7u7sjIyNjY2J6engAAAI6OjsbGxjIyMlJSUuzs7KamppSUlPLy8oKCghwcHLKysqSkpJqamvT09Pj4+KioqM7OzkRERAwMDGBgYN7e3ujo6Ly8vCoqKjY2NkZGRtTU1MTExDw8PE5OTj4+PkhISNDQ0MrKylpaWrS0tOrq6nBwcKysrLi4uLq6ul5eXlxcXGJiYoaGhuDg4H5+fvz8/KKiohgYGCwsLFZWVgQEBFBQUMzMzDg4OFhYWBoaGvDw8NbW1pycnOLi4ubm5kBAQKqqqiQkJCAgIK6urnJyckpKSjQ0NGpqatLS0sDAwCYmJnx8fEJCQlRUVAoKCggICLCwsOTk5ExMTPb29ra2tmZmZmhoaNzc3KCgoBISEiIiIgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCAAAACwAAAAAEAAQAAAHaIAAgoMgIiYlg4kACxIaACEJCSiKggYMCRselwkpghGJBJEcFgsjJyoAGBmfggcNEx0flBiKDhQFlIoCCA+5lAORFb4AJIihCRbDxQAFChAXw9HSqb60iREZ1omqrIPdJCTe0SWI09GBACH5BAkIAAAALAAAAAAQABAAAAdrgACCgwc0NTeDiYozCQkvOTo9GTmDKy8aFy+NOBA7CTswgywJDTIuEjYFIY0JNYMtKTEFiRU8Pjwygy4ws4owPyCKwsMAJSTEgiQlgsbIAMrO0dKDGMTViREZ14kYGRGK38nHguHEJcvTyIEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDAggPg4iJAAMJCRUAJRIqiRGCBI0WQEEJJkWDERkYAAUKEBc4Po1GiKKJHkJDNEeKig4URLS0ICImJZAkuQAhjSi/wQyNKcGDCyMnk8u5rYrTgqDVghgZlYjcACTA1sslvtHRgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCQARAtOUoQRGRiFD0kJUYWZhUhKT1OLhR8wBaaFBzQ1NwAlkIszCQkvsbOHL7Y4q4IuEjaqq0ZQD5+GEEsJTDCMmIUhtgk1lo6QFUwJVDKLiYJNUd6/hoEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4uen4ICCA+IkIsDCQkVACWmhwSpFqAABQoQF6ALTkWFnYMrVlhWvIKTlSAiJiVVPqlGhJkhqShHV1lCW4cMqSkAR1ofiwsjJyqGgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCSMhREZGIYYGY2ElYebi56fhyWQniSKAKKfpaCLFlAPhl0gXYNGEwkhGYREUywag1wJwSkHNDU3D0kJYIMZQwk8MjPBLx9eXwuETVEyAC/BOKsuEjYFhoEAIfkECQgAAAAsAAAAABAAEAAAB2eAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4ueICImip6CIQkJKJ4kigynKaqKCyMnKqSEK05StgAGQRxPYZaENqccFgIID4KXmQBhXFkzDgOnFYLNgltaSAAEpxa7BQoQF4aBACH5BAkIAAAALAAAAAAQABAAAAdogACCg4SFggJiPUqCJSWGgkZjCUwZACQkgxGEXAmdT4UYGZqCGWQ+IjKGGIUwPzGPhAc0NTewhDOdL7Ykji+dOLuOLhI2BbaFETICx4MlQitdqoUsCQ2vhKGjglNfU0SWmILaj43M5oEAOwAAAAAAAAAAAA==) no-repeat center left; } +#full_list { padding: 0; list-style: none; margin-left: 0; margin-top: 80px; font-size: 1.1em; } +#full_list ul { padding: 0; } +#full_list li { padding: 0; margin: 0; list-style: none; } +#full_list li .item { padding: 5px 5px 5px 12px; } +#noresults { padding: 7px 12px; background: #fff; } +#content.insearch #noresults { margin-left: 7px; } +li.collapsed ul { display: none; } +li a.toggle { cursor: default; position: relative; left: -5px; top: 4px; text-indent: -999px; width: 10px; height: 9px; margin-left: -10px; display: block; float: left; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAAVdEVYdENyZWF0aW9uIFRpbWUAMy8xNC8wOeNZPpQAAAE2SURBVDiNrZTBccIwEEXfelIAHUA6CZ24BGaWO+FuzZAK4k6gg5QAdGAq+Bxs2Yqx7BzyL7Llp/VfzZeQhCTc/ezuGzKKnKSzpCxXJM8fwNXda3df5RZETlIt6YUzSQDs93sl8w3wBZxCCE10GM1OcWbWjB2mWgEH4Mfdyxm3PSepBHibgQE2wLe7r4HjEidpnXMYdQPKEMJcsZ4zs2POYQOcaPfwMVOo58zsAdMt18BuoVDPxUJRacELbXv3hUIX2vYmOUvi8C8ydz/ThjXrqKqqLbDIAdsCKBd+Wo7GWa7o9qzOQHVVVXeAbs+yHHCH4aTsaCOQqunmUy1yBUAXkdMIfMlgF5EXLo2OpV/c/Up7jG4hhHcYLgWzAZXUc2b2ixsfvc/RmNNfOXD3Q/oeL9axJE1yT9IOoUu6MGUkAAAAAElFTkSuQmCC) no-repeat bottom left; } +li.collapsed a.toggle { opacity: 0.5; cursor: default; background-position: top left; } +li { color: #888; cursor: pointer; } +li.deprecated { text-decoration: line-through; font-style: italic; } +li.odd { background: #f0f0f0; } +li.even { background: #fafafa; } +.item:hover { background: #ddd; } +li small:before { content: "("; } +li small:after { content: ")"; } +li small.search_info { display: none; } +a, a:visited { text-decoration: none; color: #05a; } +li.clicked > .item { background: #05a; color: #ccc; } +li.clicked > .item a, li.clicked > .item a:visited { color: #eee; } +li.clicked > .item a.toggle { opacity: 0.5; background-position: bottom right; } +li.collapsed.clicked a.toggle { background-position: top right; } +#search input { border: 1px solid #bbb; border-radius: 3px; } +#full_list_nav { margin-left: 10px; font-size: 0.9em; display: block; color: #aaa; } +#full_list_nav a, #nav a:visited { color: #358; } +#full_list_nav a:hover { background: transparent; color: #5af; } +#full_list_nav span:after { content: ' | '; } +#full_list_nav span:last-child:after { content: ''; } + +#content h1 { margin-top: 0; } +li { white-space: nowrap; cursor: normal; } +li small { display: block; font-size: 0.8em; } +li small:before { content: ""; } +li small:after { content: ""; } +li small.search_info { display: none; } +#search { width: 170px; position: static; margin: 3px; margin-left: 10px; font-size: 0.9em; color: #888; padding-left: 0; padding-right: 24px; } +#content.insearch #search { background-position: center right; } +#search input { width: 110px; } + +#full_list.insearch ul { display: block; } +#full_list.insearch .item { display: none; } +#full_list.insearch .found { display: block; padding-left: 11px !important; } +#full_list.insearch li a.toggle { display: none; } +#full_list.insearch li small.search_info { display: block; } diff --git a/docs/css/style.css b/docs/css/style.css new file mode 100644 index 0000000..f682a69 --- /dev/null +++ b/docs/css/style.css @@ -0,0 +1,492 @@ +html { + width: 100%; + height: 100%; +} +body { + font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; + font-size: 13px; + width: 100%; + margin: 0; + padding: 0; + display: flex; + display: -webkit-flex; + display: -ms-flexbox; +} + +#nav { + position: relative; + width: 100%; + height: 100%; + border: 0; + border-right: 1px dotted #eee; + overflow: auto; +} +.nav_wrap { + margin: 0; + padding: 0; + width: 20%; + height: 100%; + position: relative; + display: flex; + display: -webkit-flex; + display: -ms-flexbox; + flex-shrink: 0; + -webkit-flex-shrink: 0; + -ms-flex: 1 0; +} +#resizer { + position: absolute; + right: -5px; + top: 0; + width: 10px; + height: 100%; + cursor: col-resize; + z-index: 9999; +} +#main { + flex: 5 1; + -webkit-flex: 5 1; + -ms-flex: 5 1; + outline: none; + position: relative; + background: #fff; + padding: 1.2em; + padding-top: 0.2em; +} + +@media (max-width: 920px) { + .nav_wrap { width: 100%; top: 0; right: 0; overflow: visible; position: absolute; } + #resizer { display: none; } + #nav { + z-index: 9999; + background: #fff; + display: none; + position: absolute; + top: 40px; + right: 12px; + width: 500px; + max-width: 80%; + height: 80%; + overflow-y: scroll; + border: 1px solid #999; + border-collapse: collapse; + box-shadow: -7px 5px 25px #aaa; + border-radius: 2px; + } +} + +@media (min-width: 920px) { + body { height: 100%; overflow: hidden; } + #main { height: 100%; overflow: auto; } + #search { display: none; } +} + +#main img { max-width: 100%; } +h1 { font-size: 25px; margin: 1em 0 0.5em; padding-top: 4px; border-top: 1px dotted #d5d5d5; } +h1.noborder { border-top: 0px; margin-top: 0; padding-top: 4px; } +h1.title { margin-bottom: 10px; } +h1.alphaindex { margin-top: 0; font-size: 22px; } +h2 { + padding: 0; + padding-bottom: 3px; + border-bottom: 1px #aaa solid; + font-size: 1.4em; + margin: 1.8em 0 0.5em; + position: relative; +} +h2 small { font-weight: normal; font-size: 0.7em; display: inline; position: absolute; right: 0; } +h2 small a { + display: block; + height: 20px; + border: 1px solid #aaa; + border-bottom: 0; + border-top-left-radius: 5px; + background: #f8f8f8; + position: relative; + padding: 2px 7px; +} +.clear { clear: both; } +.inline { display: inline; } +.inline p:first-child { display: inline; } +.docstring, .tags, #filecontents { font-size: 15px; line-height: 1.5145em; } +.docstring p > code, .docstring p > tt, .tags p > code, .tags p > tt { + color: #c7254e; background: #f9f2f4; padding: 2px 4px; font-size: 1em; + border-radius: 4px; +} +.docstring h1, .docstring h2, .docstring h3, .docstring h4 { padding: 0; border: 0; border-bottom: 1px dotted #bbb; } +.docstring h1 { font-size: 1.2em; } +.docstring h2 { font-size: 1.1em; } +.docstring h3, .docstring h4 { font-size: 1em; border-bottom: 0; padding-top: 10px; } +.summary_desc .object_link a, .docstring .object_link a { + font-family: monospace; font-size: 1.05em; + color: #05a; background: #EDF4FA; padding: 2px 4px; font-size: 1em; + border-radius: 4px; +} +.rdoc-term { padding-right: 25px; font-weight: bold; } +.rdoc-list p { margin: 0; padding: 0; margin-bottom: 4px; } +.summary_desc pre.code .object_link a, .docstring pre.code .object_link a { + padding: 0px; background: inherit; color: inherit; border-radius: inherit; +} + +/* style for */ +#filecontents table, .docstring table { border-collapse: collapse; } +#filecontents table th, #filecontents table td, +.docstring table th, .docstring table td { border: 1px solid #ccc; padding: 8px; padding-right: 17px; } +#filecontents table tr:nth-child(odd), +.docstring table tr:nth-child(odd) { background: #eee; } +#filecontents table tr:nth-child(even), +.docstring table tr:nth-child(even) { background: #fff; } +#filecontents table th, .docstring table th { background: #fff; } + +/* style for
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Node NameIP Address
node0 (seed 1)110.82.155.0
node1110.82.155.1
node2110.82.155.2
node3 (seed 2)110.82.156.3
node4110.82.156.4
node5110.82.156.5
+ +

Each node is configured to use the GossipingPropertyFileSnitch and 256 virtual +nodes (vnodes). The name of the cluster is MyCassandraCluster. Also, +while building the initial cluster, we are setting the auto_bootstrap +to false.

+ +

In this initial example, we are going to expand the example by:

+ + + +
node /^node\d+$/ {
+  class { 'cassandra::datastax_repo':
+    before => Class['cassandra']
+  }
+
+  class { 'cassandra::java':
+    before => Class['cassandra']
+  }
+
+  class { 'cassandra':
+    settings       => {
+      'authenticator'               => 'AllowAllAuthenticator',
+      'auto_bootstrap'              => false,
+      'cluster_name'                => 'MyCassandraCluster',
+      'commitlog_directory'         => '/var/lib/cassandra/commitlog',
+      'commitlog_sync'              => 'periodic',
+      'commitlog_sync_period_in_ms' => 10000,
+      'data_file_directories'       => ['/var/lib/cassandra/data'],
+      'endpoint_snitch'             => 'GossipingPropertyFileSnitch',
+      'hints_directory'             => '/var/lib/cassandra/hints',
+      'listen_interface'            => 'eth1',
+      'num_tokens'                  => 256,
+      'partitioner'                 => 'org.apache.cassandra.dht.Murmur3Partitioner',
+      'saved_caches_directory'      => '/var/lib/cassandra/saved_caches',
+      'seed_provider'               => [
+        {
+          'class_name' => 'org.apache.cassandra.locator.SimpleSeedProvider',
+          'parameters' => [
+            {
+              'seeds' => '110.82.155.0,110.82.156.3',
+            },
+          ],
+        },
+      ],
+      'start_native_transport'      => true,
+    },
+  }
+}
+
+ +

The default value for the num_tokens is already 256, but it is +included in the example for clarity. Do not forget to either +set auto_bootstrap to true or not set the attribute at all +after initializing the cluster.

+ +

Create a Cluster in Multiple Data Centers

+ +

To continue with the examples provided by DataStax, we look at the example +for a cluster across multiple data centers +http://docs.datastax.com/en/cassandra/2.2/cassandra/initialize/initMultipleDS.html.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Node NameIP AddressData CenterRack
node0 (seed 1)10.168.66.41DC1RAC1
node110.176.43.66DC1RAC1
node210.168.247.41DC1RAC1
node3 (seed 2)10.176.170.59DC2RAC1
node410.169.61.170DC2RAC1
node510.169.30.138DC2RAC1
+ +

For the sake of simplicity, we will confine this example to the nodes:

+ +
node /^node[012]$/ {
+  class { 'cassandra':
+    dc             => 'DC1',
+    settings       => {
+      'authenticator'               => 'AllowAllAuthenticator',
+      'auto_bootstrap'              => false,
+      'cluster_name'                => 'MyCassandraCluster',
+      'commitlog_directory'         => '/var/lib/cassandra/commitlog',
+      'commitlog_sync'              => 'periodic',
+      'commitlog_sync_period_in_ms' => 10000,
+      'data_file_directories'       => ['/var/lib/cassandra/data'],
+      'endpoint_snitch'             => 'GossipingPropertyFileSnitch',
+      'hints_directory'             => '/var/lib/cassandra/hints',
+      'listen_interface'            => 'eth1',
+      'num_tokens'                  => 256,
+      'partitioner'                 => 'org.apache.cassandra.dht.Murmur3Partitioner',
+      'saved_caches_directory'      => '/var/lib/cassandra/saved_caches',
+      'seed_provider'               => [
+        {
+          'class_name' => 'org.apache.cassandra.locator.SimpleSeedProvider',
+          'parameters' => [
+            {
+              'seeds' => '110.82.155.0,110.82.156.3',
+            },
+          ],
+        },
+      ],
+      'start_native_transport'      => true,
+    },
+  }
+}
+
+node /^node[345]$/ {
+  class { 'cassandra':
+    dc             => 'DC2',
+    settings       => {
+      'authenticator'               => 'AllowAllAuthenticator',
+      'auto_bootstrap'              => false,
+      'cluster_name'                => 'MyCassandraCluster',
+      'commitlog_directory'         => '/var/lib/cassandra/commitlog',
+      'commitlog_sync'              => 'periodic',
+      'commitlog_sync_period_in_ms' => 10000,
+      'data_file_directories'       => ['/var/lib/cassandra/data'],
+      'endpoint_snitch'             => 'GossipingPropertyFileSnitch',
+      'hints_directory'             => '/var/lib/cassandra/hints',
+      'listen_interface'            => 'eth1',
+      'num_tokens'                  => 256,
+      'partitioner'                 => 'org.apache.cassandra.dht.Murmur3Partitioner',
+      'saved_caches_directory'      => '/var/lib/cassandra/saved_caches',
+      'seed_provider'               => [
+        {
+          'class_name' => 'org.apache.cassandra.locator.SimpleSeedProvider',
+          'parameters' => [
+            {
+              'seeds' => '110.82.155.0,110.82.156.3',
+            },
+          ],
+        },
+      ],
+      'start_native_transport'      => true,
+    },
+  }
+}
+
+ +

We don't need to specify the rack name (with the rack attribute) as RAC1 is +the default value. Again, do not forget to either set auto_bootstrap to +true or not set the attribute at all after initializing the cluster.

+ +

DataStax Enterprise

+ +

After configuring the relevant repository, the following snippet works on +CentOS 7 to install DSE Cassandra 4.7.0, set the HADOOP_LOG_DIR, set the +DSE_HOME and configure DataStax Enterprise to use LDAP for authentication:

+ +
class { 'cassandra::datastax_repo':
+  descr   => 'DataStax Repo for DataStax Enterprise',
+  pkg_url => 'https://username:password@rpm.datastax.com/enterprise',
+  before  => Class['cassandra'],
+}
+
+class { 'cassandra':
+  cluster_name    => 'MyCassandraCluster',
+  config_path     => '/etc/dse/cassandra',
+  package_ensure  => '4.7.0-1',
+  package_name    => 'dse-full',
+  service_name    => 'dse',
+  ...
+}
+
+class { 'cassandra::dse':
+  file_lines => {
+    'Set HADOOP_LOG_DIR directory' => {
+      ensure => present,
+      path   => '/etc/dse/dse-env.sh',
+      line   => 'export HADOOP_LOG_DIR=/var/log/hadoop',
+      match  => '^# export HADOOP_LOG_DIR=<log_dir>',
+    },
+    'Set DSE_HOME'                 => {
+      ensure => present,
+      path   => '/etc/dse/dse-env.sh',
+      line   => 'export DSE_HOME=/usr/share/dse',
+      match  => '^#export DSE_HOME',
+    },
+  },
+  settings   => {
+    ldap_options => {
+      server_host                => localhost,
+      server_port                => 389,
+      search_dn                  => 'cn=Admin',
+      search_password            => secret,
+      use_ssl                    => false,
+      use_tls                    => false,
+      truststore_type            => jks,
+      user_search_base           => 'ou=users,dc=example,dc=com',
+      user_search_filter         => '(uid={0})',
+      credentials_validity_in_ms => 0,
+      connection_pool            => {
+        max_active => 8,
+        max_idle   => 8,
+      }
+    }
+  }
+}
+
+ +

Apache Cassandra

+ +

DataStax announced in late October 2016 that it was no longer supporting +the community edition of Cassandra or DSC as it was known (see +[Take a bow Planet +Cassandra](http://www.datastax.com/2016/10/take-a-bow-planet-cassandra) +for details). However, the following snippet of code running on Ubuntu +14.04 worked fine without having to change any of the ::cassandra class +settings:

+ +
require cassandra::java
+include cassandra::optutils
+
+class { 'cassandra::apache_repo':
+  release => '310x',
+  before  => Class['cassandra', 'cassandra::optutils'],
+}
+
+class { 'cassandra':
+  ...
+}
+
+ +

Reference

+ +

The reference documentation is generated using the +puppet-strings tool. To see +all of it, please go to +http://voxpupuli.github.io/puppet-cassandra.

+ +

Limitations

+ + + +

Development

+ +

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.

+ +

Please also see the +CONTRIBUTING.md +page for project specific requirements.

+ +

Additional Contributers

+ +

For a list of contributers see +CONTRIBUTING.md +and https://github.com/voxpupuli/puppet-cassandra/graphs/contributors

+ + + + + + + \ No newline at end of file diff --git a/docs/frames.html b/docs/frames.html new file mode 100644 index 0000000..3f1d814 --- /dev/null +++ b/docs/frames.html @@ -0,0 +1,17 @@ + + + + + Documentation by YARD 0.9.10 + + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..67563bf --- /dev/null +++ b/docs/index.html @@ -0,0 +1,824 @@ + + + + + + + File: README + + — Documentation by YARD 0.9.10 + + + + + + + + + + + + + + + + + + + +
+ + +

Cassandra

+ +

Build Status

+ +

Table of Contents

+ +
    +
  1. Overview
  2. +
  3. Setup - The basics of getting started with Cassandra + +
  4. +
  5. Usage - Configuration options and additional functionality + +
  6. +
  7. Reference
  8. +
  9. Limitations - OS compatibility, etc.
  10. +
  11. Development
  12. +
+ +

Overview

+ +

A Puppet module to install and manage Cassandra, DataStax Agent & OpsCenter

+ +

Setup

+ +

What Cassandra affects

+ +

What the Cassandra class affects

+ +
    +
  • Installs the Cassandra package (default cassandra22 on Red Hat and +cassandra on Debian).
  • +
  • Configures settings in ${config_path}/cassandra.yaml.
  • +
  • On CentOS 7 if the init service provider is used, then cassandra +is added as a system service.
  • +
  • Optionally ensures that the Cassandra service is enabled and running.
  • +
  • On Debian systems: + +
      +
    • Optionally replace /etc/init.d/cassandra with a workaround for +CASSANDRA-9822.
    • +
  • +
+ +

What the cassandra::datastax_agent class affects

+ +
    +
  • Optionally installs the DataStax agent.
  • +
  • Optionally sets JAVA_HOME in /etc/default/datastax-agent.
  • +
+ +

What the cassandra::datastax_repo class affects

+ +
    +
  • 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 Debian).
  • +
+ +

What the cassandra::dse class affects

+ +
    +
  • Optionally configures files in the /etc/dse directory if one is using +DataStax Enterprise.
  • +
+ +

What the cassandra::firewall_ports class affects

+ +
    +
  • Optionally configures the firewall for the Cassandra related network +ports.
  • +
+ +

What the cassandra::java class affects

+ +
    +
  • Optionally installs a JRE/JDK package (e.g. java-1.7.0-openjdk) and the +Java Native Access (JNA).
  • +
+ +

What the cassandra::optutils class affects

+ +
    +
  • Optionally installs the Cassandra support tools (e.g. cassandra22-tools).
  • +
+ +

Upgrading

+ +

We follow SemVer Versioning and an update of the major +release (i.e. from 1.Y.Z to 2.Y.Z) will indicate a significant change +to the API which will most probably require a change to your manifest.

+ +

Changes in 2.0.0

+ +

This is a major change to the API and you will more than likely need to +change your manifest to accomodate these changes.

+ +

The service_ensure attribute of the cassandra class now defaults to +undef, users who do want to manage service status in Puppet can still set +it to true. If leaving the value at the default and setting +service_refresh and service_enable to false will mean that the +user and not Puppet running will control the running state of +Cassandra. This currently works OK on the Red Hat family, but +has issues on Debian due to +CASSANDRA-2356 +during an initial install or package upgrade.

+ +

All the functionality relating to OpsCenter has been divested to the +locp/opscenter module on +Puppet Forge.

+ +

It should also be noted that the module no longer creates directories for +the data, commitlog, saved_caches and for Cassandra 3 the hints +directory. These resources will now need to be defined in your +manifest/profile.

+ +

For a list of features that have been deprecated in this release, please see +https://github.com/voxpupuli/puppet-cassandra/wiki/Deprecations

+ +

For details on migrating from the version 1.X.X attributes to the settings +hash, see +(https://github.com/voxpupuli/puppet-cassandra/wiki/Suggested-Baseline-Settings)

+ +

Please also see the notes for 2.0.0 in the +CHANGELOG.

+ +

Changes in 1.19.0

+ +

The hints_directory documentation will cause a change in the cassandra.yaml +file regardless of the value you set it to. If you do not wish this to +result in a refesh of the Cassandra service, please set service_refresh to +false.

+ +

Changes in 1.9.2

+ +

Now that Cassandra 3 is available from the DataStax repositories, there is +a problem (especially on Debian) with the operating system package manager +attempting to install Cassandra 3. This can be mitigated against using +something similar to the code in this modules acceptance test. Please note +that the default Cassandra package name has now been changed from 'dsc'. See +the documentation for cassandra::package_name below for details.

+ +
 if $::osfamily == 'RedHat' {
+   $version = '2.2.4-1'
+ } else {
+   $version = '2.2.4'
+ }
+
+ class { 'cassandra':
+   package_ensure => $version,
+ }
+
+ +

Changes in 1.8.0

+ +

A somewhat embarrassing correction to the spelling of the +cassandra::fail_on_non_suppoted_os to cassandra::fail_on_non_supported_os.

+ +

Issues when Upgrading to 1.4.0

+ +

Unfortunately both releases 1.3.7 and 1.4.0 have subsequently been found to +call a refresh service even when no changes had been made to the underlying +configuration. In release 1.8.0 (somewhat belatedly) the service_refresh +flag has been introduced to mitigate against similar problems.

+ +

Issues When Upgrading to 1.3.7

+ +
    +
  • Please see the notes for 1.4.0.
  • +
+ +

Changes in 1.0.0

+ +
    +
  • cassandra::cassandra_package_ensure has been renamed to +cassandra::package_ensure.
  • +
  • cassandra::cassandra_package_name has been renamed to +cassandra::package_name.
  • +
+ +

Changes in 0.4.0

+ +

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.
  • +
+ +

Changes in 0.3.0

+ +
    +
  • cassandra_opt_package_ensure changed from 'present' to undef.

  • +
  • The manage_service option has been replaced with service_enable and +service_ensure.

  • +
+ +

Beginning with Cassandra

+ +

Create a Cassandra 2.X cluster called MyCassandraCluster which uses the +GossipingPropertyFileSnitch and password authentication. In this very +basic example the node itself becomes a seed for the cluster and the +credentials will default to a user called cassandra with a password +called of cassandra.

+ +
# Cassandra pre-requisites
+include cassandra::datastax_repo
+include cassandra::java
+
+class { 'cassandra':
+  settings => {
+    'authenticator'               => 'PasswordAuthenticator',
+    'cluster_name'                => 'MyCassandraCluster',
+    'commitlog_directory'         => '/var/lib/cassandra/commitlog',
+    'commitlog_sync'              => 'periodic',
+    'commitlog_sync_period_in_ms' => 10000,
+    'data_file_directories'       => ['/var/lib/cassandra/data'],
+    'endpoint_snitch'             => 'GossipingPropertyFileSnitch',
+    'listen_address'              => $::ipaddress,
+    'partitioner'                 => 'org.apache.cassandra.dht.Murmur3Partitioner',
+    'saved_caches_directory'      => '/var/lib/cassandra/saved_caches',
+    'seed_provider'               => [
+      {
+        'class_name' => 'org.apache.cassandra.locator.SimpleSeedProvider',
+        'parameters' => [
+          {
+            'seeds' => $::ipaddress,
+          },
+        ],
+      },
+    ],
+    'start_native_transport'      => true,
+  },
+  require  => Class['cassandra::datastax_repo', 'cassandra::java'],
+}
+
+ +

However, PLEASE note that this is the ABSOLUTE MINIMUM configuration +to get Cassandra up and running but will probably give you a rather badly +configured node. Please see +Suggested Baseline Settings +for details on making your configuration a lot more robust.

+ +

For this code to run with version 3.X of Cassandra, the hints_directory will +also need to be specified:

+ +
...
+
+class { 'cassandra':
+  settings => {
+    ...
+    'hints_directory'             => '/var/lib/cassandra/hints',
+    ...
+  },
+  require  => Class['cassandra::datastax_repo', 'cassandra::java'],
+}
+
+ +

Hiera

+ +

In your top level node classification (usually common.yaml), add the +settings hash and all the tweaks you want all the clusters to use:

+ +
cassandra::baseline_settings:
+  authenticator: AllowAllAuthenticator
+  authorizer: AllowAllAuthorizer
+  auto_bootstrap: true
+  auto_snapshot: true
+  ...
+
+ +

Then, in the individual node classification add the parts which define +the cluster:

+ +
cassandra::settings:
+  cluster_name: developer playground cassandra cluster
+cassandra::dc: Onsite1
+cassandra::rack: RAC1
+cassandra::package_ensure: 3.0.5-1
+cassandra::package_name: cassandra30
+
+ +

Usage

+ +

Setup a keyspace and users

+ +

We assume that authentication has been enabled for the cassandra +cluster and we are connecting with the default user name and password +('cassandra/cassandra').

+ +

In this example, we create a keyspace (mykeyspace) with a table called +'users' and an index called 'users_lname_idx'.

+ +

We also add three users (to Cassandra, not the mykeyspace.users +table) called spillman, akers and boone while ensuring that a user +called lucan is absent.

+ +
class { 'cassandra':
+  ...
+}
+
+class { 'cassandra::schema':
+  cqlsh_password => 'cassandra',
+  cqlsh_user     => 'cassandra',
+  cqlsh_host     => $::ipaddress,
+  indexes        => {
+    'users_lname_idx' => {
+      table    => 'users',
+      keys     => 'lname',
+      keyspace => 'mykeyspace',
+    },
+  },
+  keyspaces      => {
+    'mykeyspace' => {
+      durable_writes  => false,
+      replication_map => {
+        keyspace_class     => 'SimpleStrategy',
+        replication_factor => 1,
+      },
+    }
+  },
+  permissions    => {
+    'Grant select permissions to spillman to all keyspaces' => {
+      permission_name => 'SELECT',
+      user_name       => 'spillman',
+    },
+    'Grant modify to to keyspace mykeyspace to akers'       => {
+      keyspace_name   => 'mykeyspace',
+      permission_name => 'MODIFY',
+      user_name       => 'akers',
+    },
+    'Grant alter permissions to mykeyspace to boone'        => {
+      keyspace_name   => 'mykeyspace',
+      permission_name => 'ALTER',
+      user_name       => 'boone',
+    },
+    'Grant ALL permissions to mykeyspace.users to gbennet'  => {
+      keyspace_name   => 'mykeyspace',
+      permission_name => 'ALTER',
+      table_name      => 'users',
+      user_name       => 'gbennet',
+    },
+  },
+  tables         => {
+    'users' => {
+      columns  => {
+        user_id       => 'int',
+        fname         => 'text',
+        lname         => 'text',
+        'PRIMARY KEY' => '(user_id)',
+      },
+      keyspace => 'mykeyspace',
+    },
+  },
+  users          => {
+    'spillman' => {
+      password => 'Niner27',
+    },
+    'akers'    => {
+      password  => 'Niner2',
+      superuser => true,
+    },
+    'boone'    => {
+      password => 'Niner75',
+    },
+    'gbennet'  => {
+      'password' => 'foobar',
+    },
+    'lucan'    => {
+      'ensure' => absent
+    },
+  },
+}
+
+ +

Create a Cluster in a Single Data Center

+ +

In the DataStax documentation Initializing a multiple node cluster (single +data center) +http://docs.datastax.com/en/cassandra/2.2/cassandra/initialize/initSingleDS.html +there is a basic example of a six node cluster with two seeds to be created in +a single data center spanning two racks. The nodes in the cluster are:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Node NameIP Address
node0 (seed 1)110.82.155.0
node1110.82.155.1
node2110.82.155.2
node3 (seed 2)110.82.156.3
node4110.82.156.4
node5110.82.156.5
+ +

Each node is configured to use the GossipingPropertyFileSnitch and 256 virtual +nodes (vnodes). The name of the cluster is MyCassandraCluster. Also, +while building the initial cluster, we are setting the auto_bootstrap +to false.

+ +

In this initial example, we are going to expand the example by:

+ +
    +
  • Ensuring that the software is installed via the DataStax Community +repository by including cassandra::datastax_repo. This needs to be +executed before the Cassandra package is installed.
  • +
  • That a suitable Java Runtime environment (JRE) is installed with Java Native +Access (JNA) by including cassandra::java. This need to be executed +before the Cassandra service is started.
  • +
+ +
node /^node\d+$/ {
+  class { 'cassandra::datastax_repo':
+    before => Class['cassandra']
+  }
+
+  class { 'cassandra::java':
+    before => Class['cassandra']
+  }
+
+  class { 'cassandra':
+    settings       => {
+      'authenticator'               => 'AllowAllAuthenticator',
+      'auto_bootstrap'              => false,
+      'cluster_name'                => 'MyCassandraCluster',
+      'commitlog_directory'         => '/var/lib/cassandra/commitlog',
+      'commitlog_sync'              => 'periodic',
+      'commitlog_sync_period_in_ms' => 10000,
+      'data_file_directories'       => ['/var/lib/cassandra/data'],
+      'endpoint_snitch'             => 'GossipingPropertyFileSnitch',
+      'hints_directory'             => '/var/lib/cassandra/hints',
+      'listen_interface'            => 'eth1',
+      'num_tokens'                  => 256,
+      'partitioner'                 => 'org.apache.cassandra.dht.Murmur3Partitioner',
+      'saved_caches_directory'      => '/var/lib/cassandra/saved_caches',
+      'seed_provider'               => [
+        {
+          'class_name' => 'org.apache.cassandra.locator.SimpleSeedProvider',
+          'parameters' => [
+            {
+              'seeds' => '110.82.155.0,110.82.156.3',
+            },
+          ],
+        },
+      ],
+      'start_native_transport'      => true,
+    },
+  }
+}
+
+ +

The default value for the num_tokens is already 256, but it is +included in the example for clarity. Do not forget to either +set auto_bootstrap to true or not set the attribute at all +after initializing the cluster.

+ +

Create a Cluster in Multiple Data Centers

+ +

To continue with the examples provided by DataStax, we look at the example +for a cluster across multiple data centers +http://docs.datastax.com/en/cassandra/2.2/cassandra/initialize/initMultipleDS.html.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Node NameIP AddressData CenterRack
node0 (seed 1)10.168.66.41DC1RAC1
node110.176.43.66DC1RAC1
node210.168.247.41DC1RAC1
node3 (seed 2)10.176.170.59DC2RAC1
node410.169.61.170DC2RAC1
node510.169.30.138DC2RAC1
+ +

For the sake of simplicity, we will confine this example to the nodes:

+ +
node /^node[012]$/ {
+  class { 'cassandra':
+    dc             => 'DC1',
+    settings       => {
+      'authenticator'               => 'AllowAllAuthenticator',
+      'auto_bootstrap'              => false,
+      'cluster_name'                => 'MyCassandraCluster',
+      'commitlog_directory'         => '/var/lib/cassandra/commitlog',
+      'commitlog_sync'              => 'periodic',
+      'commitlog_sync_period_in_ms' => 10000,
+      'data_file_directories'       => ['/var/lib/cassandra/data'],
+      'endpoint_snitch'             => 'GossipingPropertyFileSnitch',
+      'hints_directory'             => '/var/lib/cassandra/hints',
+      'listen_interface'            => 'eth1',
+      'num_tokens'                  => 256,
+      'partitioner'                 => 'org.apache.cassandra.dht.Murmur3Partitioner',
+      'saved_caches_directory'      => '/var/lib/cassandra/saved_caches',
+      'seed_provider'               => [
+        {
+          'class_name' => 'org.apache.cassandra.locator.SimpleSeedProvider',
+          'parameters' => [
+            {
+              'seeds' => '110.82.155.0,110.82.156.3',
+            },
+          ],
+        },
+      ],
+      'start_native_transport'      => true,
+    },
+  }
+}
+
+node /^node[345]$/ {
+  class { 'cassandra':
+    dc             => 'DC2',
+    settings       => {
+      'authenticator'               => 'AllowAllAuthenticator',
+      'auto_bootstrap'              => false,
+      'cluster_name'                => 'MyCassandraCluster',
+      'commitlog_directory'         => '/var/lib/cassandra/commitlog',
+      'commitlog_sync'              => 'periodic',
+      'commitlog_sync_period_in_ms' => 10000,
+      'data_file_directories'       => ['/var/lib/cassandra/data'],
+      'endpoint_snitch'             => 'GossipingPropertyFileSnitch',
+      'hints_directory'             => '/var/lib/cassandra/hints',
+      'listen_interface'            => 'eth1',
+      'num_tokens'                  => 256,
+      'partitioner'                 => 'org.apache.cassandra.dht.Murmur3Partitioner',
+      'saved_caches_directory'      => '/var/lib/cassandra/saved_caches',
+      'seed_provider'               => [
+        {
+          'class_name' => 'org.apache.cassandra.locator.SimpleSeedProvider',
+          'parameters' => [
+            {
+              'seeds' => '110.82.155.0,110.82.156.3',
+            },
+          ],
+        },
+      ],
+      'start_native_transport'      => true,
+    },
+  }
+}
+
+ +

We don't need to specify the rack name (with the rack attribute) as RAC1 is +the default value. Again, do not forget to either set auto_bootstrap to +true or not set the attribute at all after initializing the cluster.

+ +

DataStax Enterprise

+ +

After configuring the relevant repository, the following snippet works on +CentOS 7 to install DSE Cassandra 4.7.0, set the HADOOP_LOG_DIR, set the +DSE_HOME and configure DataStax Enterprise to use LDAP for authentication:

+ +
class { 'cassandra::datastax_repo':
+  descr   => 'DataStax Repo for DataStax Enterprise',
+  pkg_url => 'https://username:password@rpm.datastax.com/enterprise',
+  before  => Class['cassandra'],
+}
+
+class { 'cassandra':
+  cluster_name    => 'MyCassandraCluster',
+  config_path     => '/etc/dse/cassandra',
+  package_ensure  => '4.7.0-1',
+  package_name    => 'dse-full',
+  service_name    => 'dse',
+  ...
+}
+
+class { 'cassandra::dse':
+  file_lines => {
+    'Set HADOOP_LOG_DIR directory' => {
+      ensure => present,
+      path   => '/etc/dse/dse-env.sh',
+      line   => 'export HADOOP_LOG_DIR=/var/log/hadoop',
+      match  => '^# export HADOOP_LOG_DIR=<log_dir>',
+    },
+    'Set DSE_HOME'                 => {
+      ensure => present,
+      path   => '/etc/dse/dse-env.sh',
+      line   => 'export DSE_HOME=/usr/share/dse',
+      match  => '^#export DSE_HOME',
+    },
+  },
+  settings   => {
+    ldap_options => {
+      server_host                => localhost,
+      server_port                => 389,
+      search_dn                  => 'cn=Admin',
+      search_password            => secret,
+      use_ssl                    => false,
+      use_tls                    => false,
+      truststore_type            => jks,
+      user_search_base           => 'ou=users,dc=example,dc=com',
+      user_search_filter         => '(uid={0})',
+      credentials_validity_in_ms => 0,
+      connection_pool            => {
+        max_active => 8,
+        max_idle   => 8,
+      }
+    }
+  }
+}
+
+ +

Apache Cassandra

+ +

DataStax announced in late October 2016 that it was no longer supporting +the community edition of Cassandra or DSC as it was known (see +[Take a bow Planet +Cassandra](http://www.datastax.com/2016/10/take-a-bow-planet-cassandra) +for details). However, the following snippet of code running on Ubuntu +14.04 worked fine without having to change any of the ::cassandra class +settings:

+ +
require cassandra::java
+include cassandra::optutils
+
+class { 'cassandra::apache_repo':
+  release => '310x',
+  before  => Class['cassandra', 'cassandra::optutils'],
+}
+
+class { 'cassandra':
+  ...
+}
+
+ +

Reference

+ +

The reference documentation is generated using the +puppet-strings tool. To see +all of it, please go to +http://voxpupuli.github.io/puppet-cassandra.

+ +

Limitations

+ +
    +
  • When using a Ruby version before 1.9.0, the contents of the Cassandra +configuration file may change order of elements due to a problem with +to_yaml in earlier versions of Ruby.
  • +
  • When creating key spaces, indexes, cql_types and users the settings will only +be used to create a new resource if it does not currently exist. If a change +is made to the Puppet manifest but the resource already exits, this change +will not be reflected.
  • +
  • At the moment the cassandra::system::transparent_hugepage does not +persist between reboots.
  • +
  • Acceptance for Debian 7 are confined to Cassandra 2.1 and 2.2. There is +a conflict between the GLIBC on Debian 7 and the newer releases of Cassandra +3.X.
  • +
+ +

Development

+ +

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.

+ +

Please also see the +CONTRIBUTING.md +page for project specific requirements.

+ +

Additional Contributers

+ +

For a list of contributers see +CONTRIBUTING.md +and https://github.com/voxpupuli/puppet-cassandra/graphs/contributors

+
+ + + +
+ + \ No newline at end of file diff --git a/docs/js/app.js b/docs/js/app.js new file mode 100644 index 0000000..b9f2120 --- /dev/null +++ b/docs/js/app.js @@ -0,0 +1,248 @@ +(function() { + +var localStorage = {}, sessionStorage = {}; +try { localStorage = window.localStorage; } catch (e) { } +try { sessionStorage = window.sessionStorage; } catch (e) { } + +function createSourceLinks() { + $('.method_details_list .source_code'). + before("[View source]"); + $('.toggleSource').toggle(function() { + $(this).parent().nextAll('.source_code').slideDown(100); + $(this).text("Hide source"); + }, + function() { + $(this).parent().nextAll('.source_code').slideUp(100); + $(this).text("View source"); + }); +} + +function createDefineLinks() { + var tHeight = 0; + $('.defines').after(" more..."); + $('.toggleDefines').toggle(function() { + tHeight = $(this).parent().prev().height(); + $(this).prev().css('display', 'inline'); + $(this).parent().prev().height($(this).parent().height()); + $(this).text("(less)"); + }, + function() { + $(this).prev().hide(); + $(this).parent().prev().height(tHeight); + $(this).text("more..."); + }); +} + +function createFullTreeLinks() { + var tHeight = 0; + $('.inheritanceTree').toggle(function() { + tHeight = $(this).parent().prev().height(); + $(this).parent().toggleClass('showAll'); + $(this).text("(hide)"); + $(this).parent().prev().height($(this).parent().height()); + }, + function() { + $(this).parent().toggleClass('showAll'); + $(this).parent().prev().height(tHeight); + $(this).text("show all"); + }); +} + +function searchFrameButtons() { + $('.full_list_link').click(function() { + toggleSearchFrame(this, $(this).attr('href')); + return false; + }); + window.addEventListener('message', function(e) { + if (e.data === 'navEscape') { + $('#nav').slideUp(100); + $('#search a').removeClass('active inactive'); + $(window).focus(); + } + }); + + $(window).resize(function() { + if ($('#search:visible').length === 0) { + $('#nav').removeAttr('style'); + $('#search a').removeClass('active inactive'); + $(window).focus(); + } + }); +} + +function toggleSearchFrame(id, link) { + var frame = $('#nav'); + $('#search a').removeClass('active').addClass('inactive'); + if (frame.attr('src') === link && frame.css('display') !== "none") { + frame.slideUp(100); + $('#search a').removeClass('active inactive'); + } + else { + $(id).addClass('active').removeClass('inactive'); + if (frame.attr('src') !== link) frame.attr('src', link); + frame.slideDown(100); + } +} + +function linkSummaries() { + $('.summary_signature').click(function() { + document.location = $(this).find('a').attr('href'); + }); +} + +function summaryToggle() { + $('.summary_toggle').click(function(e) { + e.preventDefault(); + localStorage.summaryCollapsed = $(this).text(); + $('.summary_toggle').each(function() { + $(this).text($(this).text() == "collapse" ? "expand" : "collapse"); + var next = $(this).parent().parent().nextAll('ul.summary').first(); + if (next.hasClass('compact')) { + next.toggle(); + next.nextAll('ul.summary').first().toggle(); + } + else if (next.hasClass('summary')) { + var list = $('