Using Altoros Cassandra for PCF

This topic describes how to use Altoros Cassandra for Pivotal Cloud Foundry (PCF) after it has been installed.

Use Altoros Cassandra for PCF with an App

To use Altoros Cassandra for PCF with an app, follow the procedures in this section to create a service instance and bind the service instance to your app. For more information about managing service instances, see Managing Service Instances with the cf CLI.

View the Service

After the tile has been installed, apache-cassandra and its service plans appear in your Marketplace. Run cf marketplace to see the service listing.

$ cf marketplace
Getting services from marketplace in org test / space test as admin...
OK

service            plans   description
apache-cassandra   free    Open source distributed database management system

Create a Service Instance

Use cf create-service to provision a keyspace.

$ cf create-service apache-cassandra free apache-cassandra

Check the creation status using cf services. This displays a list of all your service instances. To check the status of a specific service instance, run cf service NAME-OF-YOUR-SERVICE.

Bind the Service Instance to an App

After you have created your keyspace, run cf bind-service to bind the service to your app.

$ cf bind-service sample-app apache-cassandra

Restage or Restart Your App

To enable your app to access the service instance, run cf restage or cf restart to restage or restart your app.

Obtain Service Instance Access Credentials

After you have bound your service instance to your app, you can find the credentials of your Apache Cassandra user in the environment variables of the app.

Run cf env APP-NAME to display environment variables. The credentials are listed under the VCAP_SERVICES key.

$ cf env sample-app
Getting env variables for app sample-app in org test / space test as admin...
OK

System-Provided:
{
 "VCAP_SERVICES": {
  "apache-cassandra": [
   {
    "credentials": {
     "cql_port": 9042,
     "keyspace": "cf324d37765887be691263",
     "nodes": [
      "192.168.112.26",
      "192.168.112.27",
      "192.168.112.28"
     ],
     "password": "dfa55d87b422d3fbc308",
     "thrift_port": 9160,
     "username": "cf-e01038e30d0f68441d41"
    },
    "label": "apache-cassandra",
    "name": "apache-cassandra",
    "plan": "free",
    "provider": null,
    "syslog_drain_url": null,
    "tags": [
     "nosql",
     "database"
    ],
    "volume_mounts": []
   }
  ]
 }
 }
...

You can use these parameters to connect to Apache Cassandra.

Delete an Altoros Cassandra for PCF Service Instance

WARNING! Before deleting a service instance, you must back up the data stored in your keyspace. This operation cannot be undone, and all the data is lost when the service is deleted.

Follow the instructions below to unbind your service instance from all apps and delete it.

List Available Services

Run cf service to list your available services.

$ cf service

Getting services in org test / space test as admin...
OK

name               service             plan    bound apps   last operation
apache-cassandra   apache-cassandra    free    sample-app   create succeeded

This example shows that apache-cassandra is bound to the sample-app app.

Unbind a Service Instance

Run cf unbind to unbind the service from your app:

$ cf unbind-service sample-app apache-cassandra

Delete a Service Instance

Run cf delete-service to delete the service.

  $ cf delete-service apache-cassandra

Run the cf services command to check the deletion status.

Create a pull request or raise an issue on the source for this page in GitHub