diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3c6d693..2a1dd66 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,170 +1,170 @@ # Contributing to the Module or Raising Issues ## Table of Contents 1. [Raising an Issue](#raising-an-issue) 1. [Contribtions](#contributions) - * [Unit Tests](#unit-tests) - * [Acceptance Tests](#acceptance-tests) + * [Unit Tests](#unit-tests) + * [Acceptance Tests](#acceptance-tests) 1. [Contributors](#contributors) 1. [Further Reading](#further-reading) ## Raising an Issue When raising an issue, please provide the following information: * The version of the locp-cassandra module that you are using. * The version of Cassandra that you are installing. * The operating system and release (output from `facter os` would be appropriate). * A sample of your manifest/profile that is calling the `cassandra` module. Feel free to obfuscate sections of the code that contain details that are confidential (e.g. passwords and other secrets). ## Contributions 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. However, we do ask that at the very least, all items marked as **MUST** or **WON'T** in the list below are applicable: * Any new features (e.g. new resources or new attributes to existing resoures) **MUST** be fully documented . * Unit tests **MUST** be completing successfully. See [Unit Tests](#unit-tests) for more details. If your initial unit tests fail after a pull request and you need to fix them, simply change the code on your branch and push them to *origin* again as this will re-run the tests. It is not required to submit a new pull request. * Any new functionality or enhancements **SHOULD** be covered by unit/spec tests. If you are not comfortable with this, submit the PR anyway and we will fill in these gaps. You will most probably be asked to rebase your PR branch and then push again to register these changes. * If applicable, changes **COULD** be covered in beaker/acceptance tests. * Change **WON'T** break any functionality on any of the supported operating systems. ### Unit Tests First, you'll need to install the testing dependencies using [bundler](http://bundler.io). ```shell bundle install ``` To run all of the unit tests execute the following: ```shell bundle exec rake test ``` This should output something like the following: ``` Running RuboCop... Inspecting 24 files ........................ 24 files inspected, no offenses detected ---> syntax:manifests ---> syntax:templates ---> syntax:hiera:yaml /home/ben/.rvm/rubies/ruby-2.1.6/bin/ruby -I/home/ben/.rvm/gems/ruby-2.1.6/gems/rspec-core-3.5.4/lib:/home/ben/.rvm/gems/ruby-2.1.6/gems/rspec-support-3.5.0/lib /home/ben/.rvm/gems/ruby-2.1.6/gems/rspec-core-3.5.4/exe/rspec --pattern spec/\{aliases,classes,defines,unit,functions,hosts,integration,types\}/\*\*/\*_spec.rb --color [Coveralls] Set up the SimpleCov formatter. [Coveralls] Using SimpleCov's default settings. ....................................................... Finished in 7.86 seconds (files took 0.81841 seconds to load) 55 examples, 0 failures Total resources: 64 Touched resources: 64 Resource coverage: 100.00% [Coveralls] Outside the CI environment, not sending data. ``` Note that if you prefer, you can run the lint, syntax, and spec tests separately with individual commands: ```shell bundle exec rake metadata_lint bundle exec rake rubocop bundle exec rake lint bundle exec rake validate bundle exec rake spec ``` If in doubt, or you are stuck, please ask for help in the PR or via our [Gitter Room](https://gitter.im/locp/cassandra). The unit tests will also fail if the test coverage falls below 100%. ### Acceptance Tests These tests are more CPU intensive and are run via Docker. You will need to install further gems for this to work with the following command: ```shell bundle install --with acceptance ``` Then run the tests: ```shell bundle exec rake beaker:centos6 bundle exec rake beaker:centos7 bundle exec rake beaker:debian7 bundle exec rake beaker:debian8 bundle exec rake beaker:ubuntu1204 bundle exec rake beaker:ubuntu1404 bundle exec rake beaker:ubuntu1604 ``` ## Contributors **Release** | **PR/Issue** | **Contributer** ------------|-----------------------------------------------------|---------------------------------------------------- 2.6.0 | [Adding Red Hat OS](https://github.com/locp/cassandra/pull/396) | [@stijnvdb](https://github.com/stijnvdb) 2.3.0 | [Hiera documentation](https://github.com/locp/cassandra/pull/329) | [@tibers](https://github.com/tibers) 2.1.1 | [Correct cql_types conditional in cassandra::schema class](https://github.com/locp/cassandra/pull/325)| [@aaron-miller](https://github.com/aaron-miller) 2.0.2 | [locp/cassandra 2.0 example has two cassandra declarations](https://github.com/locp/cassandra/issues/291)| [@ericy-jana](https://github.com/ericy-jana) 2.0.0 | [Convert cassandra::file from a class to a define](https://github.com/locp/cassandra/issues/266)| [@stanleyz](https://github.com/stanleyz) 1.26.1 | [Correct cql_types conditional in cassandra::schema class](https://github.com/locp/cassandra/pull/325)| [@aaron-miller](https://github.com/aaron-miller) 1.25.2 | [Ubuntu 16 doesnt like the service file](https://github.com/locp/cassandra/issues/269)| [@ahharu](https://github.com/ahharu) 1.25.1 | [PID file name in systemd file for datastax-agent doesn't match PID file name in /etc/init.d/datastax-agent](https://github.com/locp/cassandra/issues/264)| [@pampelix](https://github.com/pampelix) 1.25.0 | [adding support for mmap](https://github.com/locp/cassandra/pull/261) | [@tibers](https://github.com/tibers) 1.24.0 | [remove varlib_dir require from data directory](https://github.com/locp/cassandra/pull/247) | [@ericy-jana](https://github.com/ericy-jana) 1.24.0 | [stage config files before installing cassandra package](https://github.com/locp/cassandra/pull/246) | [@ericy-jana](https://github.com/ericy-jana) 1.24.0 | [locp/cassandra starts two Cassandra processes](https://github.com/locp/cassandra/issues/245)| [@ericy-jana](https://github.com/ericy-jana) 1.23.0 | [attemping to realize client security](https://github.com/locp/cassandra/pull/235) | [@tibers](https://github.com/tibers) 1.22.1 | [#232 - add ordering to service definition](https://github.com/locp/cassandra/pull/233) | [@tibers](https://github.com/tibers) 1.22.1 | [module tries to start cassandra before it's installed](https://github.com/locp/cassandra/issues/232)| [@tibers](https://github.com/tibers) 1.21.0 | [Issue: Java version installed on Debian family by cassandra::java class #223](https://github.com/locp/cassandra/pull/226) | [@tibers](https://github.com/tibers) 1.20.0 | [Missing attributes in cassandra.yaml](https://github.com/locp/cassandra/issues/217)| [@samyray](https://github.com/samyray) 1.19.0 | [adding hints_directory for cassandra 3.x](https://github.com/locp/cassandra/pull/215) | [@tibers](https://github.com/tibers) 1.18.0 | [Added opscenter ldap option group_search_filter_with_dn](https://github.com/locp/cassandra/pull/203) | [@Mike-Petersen](https://github.com/Mike-Petersen) 1.15.0 | [creating vanilla cassandra 2.0.xx template](https://github.com/locp/cassandra/pull/189) | [@tibers](https://github.com/tibers) 1.14.0 | [Feature/opscenter orbited longpoll](https://github.com/locp/cassandra/pull/171) | [@jonen10](https://github.com/jonen10) 1.13.0 | [Allowing setting of async_pool_size and async_queue_size for the agent](https://github.com/locp/cassandra/pull/166) | [@Mike-Petersen](https://github.com/Mike-Petersen) 1.13.0 | [parameterized thrift_framed_transport_size_in_mb](https://github.com/locp/cassandra/pull/163) | [@VeriskPuppet](https://github.com/VeriskPuppet) 1.12.2 | [Error opening zip file or JAR manifest missing : /usr/sbin/../lib/jamm-0.3.0.jar](https://github.com/locp/cassandra/pull/165) | [@palmertime](https://github.com/palmertime) 1.12.0 | [Rename alias to agent_alias as alias is a reserved puppet word](https://github.com/locp/cassandra/pull/156) | [@stuartbfox](https://github.com/stuartbfox) 1.12.0 | [Added interfaces as an option](https://github.com/locp/cassandra/pull/153) | [@Mike-Petersen](https://github.com/Mike-Petersen) 1.10.0 | [Allowing setting of local_interface for the datastax agent configuration](https://github.com/locp/cassandra/pull/144) | [@Mike-Petersen](https://github.com/Mike-Petersen) 1.9.2 | [When installing cassandra dsc22 it tries to install cassandra 3.0.0 and as dependecy 2.2.3 is needed](https://github.com/locp/cassandra/issues/136)| [@mantunovic](https://github.com/mantunovic) 1.9.2 | [When installing cassandra dsc22 it tries to install cassandra 3.0.0 and as dependecy 2.2.3 is needed](https://github.com/locp/cassandra/issues/136)| [@al4](https://github.com/al4) 1.4.2 | [restart service if datastax agent package is upgraded](https://github.com/locp/cassandra/pull/110) | [@markasammut](https://github.com/markasammut) 1.4.0 | [allow batch_size_warn_threshold to be modified externally](https://github.com/locp/cassandra/pull/100) | [@markasammut](https://github.com/markasammut) 1.3.5 | [service_ensure unused](https://github.com/locp/cassandra/issues/93) | [@sampowers](https://github.com/sampowers) 1.3.3 | [Fails To Run With puppetlabs-apt v1.8.0](https://github.com/locp/cassandra/pull/87) | [@DylanGriffith](https://github.com/DylanGriffith) 0.4.2 | [Fix syntax in version_requirements](https://github.com/locp/cassandra/pull/34) | [@amosshapira](https://github.com/amosshapira) 0.3.0 | [Add a template for Cassandra 1.x compat](https://github.com/locp/cassandra/pull/11) | [@spredzy](https://github.com/Spredzy) ## Further Reading * *RSpec tests for your Puppet manifests* * *Beaker Info* diff --git a/LICENSE b/LICENSE index 5f939ec..6f75635 100644 --- a/LICENSE +++ b/LICENSE @@ -1,201 +1,201 @@ 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 2015 - 2017 League of Crafty Programmers Ltd. + 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. diff --git a/README.md b/README.md index e1eb0b0..e3aecef 100644 --- a/README.md +++ b/README.md @@ -1,670 +1,663 @@ # Cassandra -[![Puppet Forge](http://img.shields.io/puppetforge/v/locp/cassandra.svg)](https://forge.puppetlabs.com/locp/cassandra) -[![Github Tag](https://img.shields.io/github/tag/locp/cassandra.svg)](https://github.com/locp/cassandra) -[![Build Status](https://travis-ci.org/locp/cassandra.png?branch=master)](https://travis-ci.org/locp/cassandra) -[![Coverage Status](https://coveralls.io/repos/locp/cassandra/badge.svg?branch=master&service=github)](https://coveralls.io/github/locp/cassandra?branch=master) -[![Join the chat at https://gitter.im/locp/cassandra](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/locp/cassandra?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![CircleCI](https://circleci.com/gh/locp/cassandra.svg?style=svg)](https://circleci.com/gh/locp/cassandra) -[![Puppet Forge Downloads](http://img.shields.io/puppetforge/dt/locp/cassandra.svg)](https://forge.puppetlabs.com/locp/cassandra) -[![Puppet Forge Endorsement](https://img.shields.io/puppetforge/e/locp/cassandra.svg)](https://forge.puppetlabs.com/locp/cassandra) +[![Build Status](https://travis-ci.org/voxpupuli/puppet-cassandra.png?branch=master)](https://travis-ci.org/voxpupuli/puppet-cassandra) ## Table of Contents 1. [Overview](#overview) 1. [Setup - The basics of getting started with Cassandra](#setup) * [What Cassandra affects](#what-cassandra-affects) * [Upgrading](#upgrading) * [Beginning with Cassandra](#beginning-with-cassandra) 1. [Usage - Configuration options and additional functionality](#usage) * [Setup a keyspace and users](#setup-a-keyspace-and-users) * [Create a Cluster in a Single Data Center](#create-a-cluster-in-a-single-data-center) * [Create a Cluster in Multiple Data Centers](#create-a-cluster-in-multiple-data-centers) * [DataStax Enterprise](#datastax-enterprise) * [Apache Cassandra](#apache-cassandra) 1. [Reference](#reference) 1. [Limitations - OS compatibility, etc.](#limitations) 1. [Development](#development) ## 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](https://issues.apache.org/jira/browse/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](http://semver.org/) 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](https://issues.apache.org/jira/browse/CASSANDRA-2356) during an initial install or package upgrade. All the functionality relating to OpsCenter has been divested to the [locp/opscenter](https://forge.puppet.com/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/locp/cassandra/wiki/Deprecations +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/locp/cassandra/wiki/Suggested-Baseline-Settings) +(https://github.com/voxpupuli/puppet-cassandra/wiki/Suggested-Baseline-Settings) Please also see the notes for 2.0.0 in the -[CHANGELOG](https://forge.puppet.com/locp/cassandra/changelog). +[CHANGELOG](./CHANGELOG.md). #### 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. ```puppet 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. ```puppet # 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](https://github.com/locp/cassandra/wiki/Suggested-Baseline-Settings) +[Suggested Baseline Settings](https://github.com/voxpupuli/puppet-cassandra/wiki/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: ```puppet ... 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: ```YAML 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: ```YAML 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. ```puppet 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)_ 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 Name** | **IP Address** | ---------------|----------------| node0 (seed 1) | 110.82.155.0 | node1 | 110.82.155.1 | node2 | 110.82.155.2 | node3 (seed 2) | 110.82.156.3 | node4 | 110.82.156.4 | node5 | 110.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. ```puppet 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 . **Node Name** | **IP Address** | **Data Center** | **Rack** | ---------------|----------------|-----------------|----------| node0 (seed 1) | 10.168.66.41 | DC1 | RAC1 | node1 | 10.176.43.66 | DC1 | RAC1 | node2 | 10.168.247.41 | DC1 | RAC1 | node3 (seed 2) | 10.176.170.59 | DC2 | RAC1 | node4 | 10.169.61.170 | DC2 | RAC1 | node5 | 10.169.30.138 | DC2 | RAC1 | For the sake of simplicity, we will confine this example to the nodes: ```puppet 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: ```puppet 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=', }, '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: ```puppet 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](https://github.com/puppetlabs/puppet-strings) tool. To see all of it, please go to -[http://locp.github.io/cassandra](http://locp.github.io/cassandra/_index.html). +[http://voxpupuli.github.io/puppet-cassandra](http://voxpupuli.github.io/puppet-cassandra/_index.html). ## 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](https://github.com/locp/cassandra/blob/master/CONTRIBUTING.md) +[CONTRIBUTING.md](./CONTRIBUTING.md) page for project specific requirements. ### Additional Contributers For a list of contributers see -[CONTRIBUTING.md](https://github.com/locp/cassandra/blob/master/CONTRIBUTING.md) -and https://github.com/locp/cassandra/graphs/contributors +[CONTRIBUTING.md](./CONTRIBUTING.md) +and https://github.com/voxpupuli/puppet-cassandra/graphs/contributors diff --git a/metadata.json b/metadata.json index 6b5f331..e005050 100644 --- a/metadata.json +++ b/metadata.json @@ -1,82 +1,82 @@ { - "name": "locp-cassandra", + "name": "puppet-cassandra", "version": "2.6.0", - "author": "locp", + "author": "Vox Pupuli", "summary": "Installs Cassandra & DataStax Agent on RHEL/Ubuntu/Debian.", "license": "Apache-2.0", - "source": "https://github.com/locp/cassandra", - "project_page": "https://github.com/locp/cassandra", - "issues_url": "https://github.com/locp/cassandra/issues", + "source": "https://github.com/voxpupuli/puppet-cassandra", + "project_page": "https://github.com/voxpupuli/puppet-cassandra", + "issues_url": "https://github.com/voxpupuli/puppet-cassandra/issues", "tags": [ "Apache", "cassandra", "cluster", "database", "datastax", "datastax-agent", "nosql" ], "dependencies": [ { "name": "puppetlabs-apt", "version_requirement": ">= 2.0.0 < 3.0.0" }, { "name": "puppetlabs-firewall", "version_requirement": ">= 1.0.0 < 2.0.0" }, { "name": "puppetlabs-inifile", "version_requirement": ">= 1.5.0 < 2.0.0" }, { "name": "puppetlabs-stdlib", "version_requirement": ">= 3.0.0 < 5.0.0" } ], "operatingsystem_support": [ { "operatingsystem": "CentOS", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "RedHat", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ "7", "8" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "12.04", "14.04", "16.04" ] } ] }