Skip to content

CloudCredo/vcap_cassandra

Repository files navigation

CloudFoundry Cassandra Service

This code represent the adapter layer between [Cassandra] 1 and [CloudFoundry] 2.

Adding a service.

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.

Chef:

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.

  1. Add 'cassandra_node' and 'cassandra_gateway' to the components hash located in the file $CF_HOME/cloudfoundry/.deployments/devbox/config/vcap_components.json

  2. 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
                 ```
    
  3. On the Service host add the line File.expand_path("../../cassandra/config/cassandra_gateway.yml", __FILE__) to the default_configs hash found in the file $CF_HOME/cloudfoundry/vcap/services/tools/misc/bin/nuke_service.rb

  4. Clone [vcap_cassandra] 4 into $CF_HOME/cloudfoundry/vcap/services/

  5. 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 the runtime_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 distributiion bin directory to the $PATH or it can configured to be an absolute path pointing to the cassandra executable of your installation.

  6. Clone, build and deploy the Cassandra security module.

    1. 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]
    2. Copy the jar artifact to $CASSANDRA_INSTALL_LOCATION/lib
    3. 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
  7. On the service host add Cassandra to the gateway and node loops in the file $CF_HOME/cloudfoundry/vcap/dev_setup/lib/vcap_components.rb

  8. 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

  9. 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 command vmc services from a client targeted at the newly configured Cloud Foundry instance should reveal Cassandra as a new services.

  10. 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.

Bosh:

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.

About

Cassandra Support for Cloudfoundry

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages