This code represent the adapter layer between [Cassandra] 1 and [CloudFoundry] 2.
We have stuck as closely as possible to the Cloud Foundry conventions of adding a service. Currently we support the addition of Cassandra support through BOSH and [dev_setup] 10.
The steps for adding Cassandra as a service using Chef as briefly described below, for the official documentation on adding services to Cloud Foundry See [Adding a System Service to OSS Cloud Foundry] 3. Chef.
-
Add 'cassandra_node' and 'cassandra_gateway' to the
components
hash located in the file$CF_HOME/cloudfoundry/.deployments/devbox/config/vcap_components.json
-
Add the Cassandra service token to the
builtin_services
hash found in the file$CF_HOME/cloudfoundry/.deployments/devbox/config/cloud_controller.yml
. The cassandra token by default is 'cassandra_token'. The Cassandra built in service should look like:builtin_services: redis: token: changeredistoken mongodb: token: changemongodbtoken mysql: token: changemysqltoken cassandra: token: cassandratoken ```
-
On the Service host add the line
File.expand_path("../../cassandra/config/cassandra_gateway.yml", __FILE__)
to thedefault_configs
hash found in the file$CF_HOME/cloudfoundry/vcap/services/tools/misc/bin/nuke_service.rb
-
Clone [vcap_cassandra] 4 into
$CF_HOME/cloudfoundry/vcap/services/
-
Download and install a Cassandra distribution. We have tested vcap_cassandra against [Datastax] 6 distribution versions 1.1.6 and 1.1.7 which are available to download from the [Datastax community page] 7. We recommend that one of these versions is used for Cloud Foundry. Where Cassandra is installed is not too important as by default when provisioning a new service the cassandra_node will look for the
cassandra
executable on the sytem path ($PATH). This value is configurable via theruntime_path
property in [vcap_cassandra/config/cassandra_node.yml] 5. The property value can either remain as is in which case you must add the Cassandra distributiionbin
directory to the $PATH or it can configured to be an absolute path pointing to thecassandra
executable of your installation. -
Clone, build and deploy the Cassandra security module.
- Clone and build the Cassandra Cloud Foundry security module. You can find the code and instructions on how to build the module at [cassandra_chastity] [8]
- Copy the jar artifact to $CASSANDRA_INSTALL_LOCATION/lib
- Set authenticator and authority properties in $CASSANDRA_DEPLOYMENT/conf/cassandra.yaml to the below values:
- authenticator: com.cloudcredo.cassandra.auth.CloudFoundryAuthenticator
- authority: org.apache.cassandra.auth.AllowAllAuthority
-
On the service host add Cassandra to the
gateway
andnode
loops in the file$CF_HOME/cloudfoundry/vcap/dev_setup/lib/vcap_components.rb
-
Bundle the necessary dependencies for the Cassandra node and gateway by executing the command
source $HOME/.cloudfoundry_deployment_profile && bundle package
from the$CF_HOME/cloudfoundry/vcap/services/cassandra
directory -
Restart the cloud controller using the command
$CF_HOME/cloudfoundry/vcap/dev_setup/bin/vcap_dev restart
. A Cassandra node and gateway should now appear in the list of running components. Running the commandvmc services
from a client targeted at the newly configured Cloud Foundry instance should reveal Cassandra as a new services. -
Code to test your deployment can be found at [cassandra-test-jvm-client] 9 along with instructions on how to build and deploy to your CloudFoundry instance.
A Bosh installation has also been created that allows Cassandra to be seamlessly deployed in to a bosh deployed CloudFoundry For more information on our Bosh deployment please email chris@cloudcredo.com.
Copyright 2013 - CloudCredo Ltd.