From a67e8e2bd30226041e44a9fdeed0d8a1ce84c5c8 Mon Sep 17 00:00:00 2001 From: "Michael S. Klishin" Date: Mon, 9 Apr 2012 22:21:49 +0400 Subject: [PATCH] Initial commit --- .gitignore | 4 ++++ README.md | 40 ++++++++++++++++++++++++++++++++++++++ recipes/datastax.rb | 47 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 recipes/datastax.rb diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..7a7c37ee --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*~ +#~ +.rbx +*.class diff --git a/README.md b/README.md new file mode 100644 index 00000000..67c11d49 --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ +# Apache Cassandra Chef Cookbook + +This is an OpsCode Chef cookbook for Apache Cassandra ([DataStax Community Edition](http://www.datastax.com/products/community)). + +It uses officially released Debian packages, provides Upstart service script but has no +way to tweak Cassandra configuration parameters using Chef node attributes. The reason for +that is it was created for CI and development environments. Attributes will be used in the future, +doing so for single-server installations won't be difficult. + + +## Apache Cassandra Version + +This cookbook currently provides Apache Cassandra 1.0.x (DataStax Community Edition). + +## Supported OS Distributions + +Ubuntu 11.04, 11.10. + + +## Recipes + +Main recipe is `cassandra::datastax`. + + +## Attributes + +This cookbook is very bare bones and targets development and CI environments, there are no attributes +at the moment. + + +## Dependencies + +OpenJDK 6 or Sun JDK 6. + + +## Copyright & License + +Michael S. Klishin, Travis CI Development Team, 2012. + +Released under the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0.html). diff --git a/recipes/datastax.rb b/recipes/datastax.rb new file mode 100644 index 00000000..42edb349 --- /dev/null +++ b/recipes/datastax.rb @@ -0,0 +1,47 @@ +# +# Cookbook Name:: cassandra +# Recipe:: datastax +# +# Copyright 2011-2012, Michael S Klishin & Travis CI Development Team +# +# 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. +# + +# This recipe relies on a PPA package and is Ubuntu/Debian specific. Please +# keep this in mind. + +include_recipe "java" + +apt_repository "datastax" do + uri "http://debian.datastax.com/community" + distribution "stable" + components ["main"] + key "http://debian.datastax.com/debian/repo_key" + + action :add +end + +# DataStax Server Community Edition package will not install w/o this +# one installed. MK. +package "python-cql" do + action :install +end + +package "dsc" do + action :install +end + +service "cassandra" do + supports :restart => true, :status => true + action [:enable, :start] +end