Using Altoros Cassandra for Pivotal Platform

This topic describes how to use Altoros Cassandra for Pivotal Platform after it has been installed.

Use Altoros Cassandra for Pivotal Platform with an App

To use Altoros Cassandra for Pivotal Platform 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...

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

  "apache-cassandra": [
    "credentials": {
     "cql_port": 9042,
     "keyspace": "cf324d37765887be691263",
     "nodes": [
     "password": "dfa55d87b422d3fbc308",
     "thrift_port": 9160,
     "username": "cf-e01038e30d0f68441d41"
    "label": "apache-cassandra",
    "name": "apache-cassandra",
    "plan": "free",
    "provider": null,
    "syslog_drain_url": null,
    "tags": [
    "volume_mounts": []

You can use these parameters to connect to Apache Cassandra.

Delete an Altoros Cassandra for Pivotal Platform 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...

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, Use, and Manage On-Demand Service Instances

In order to use the Cassandra On-Demand Service Broker, do the following:

  1. Set your API endpoint to the Cloud Controller of your deployment.
    $ cf api api.YOUR-SYSTEM-DOMAIN
    Setting api endpoint to api.YOUR-SYSTEM-DOMAIN...
    API endpoint:  https://api.YOUR-SYSTEM-DOMAIN (API version: 2.59.0)
    Not logged in. Use 'cf login' to log in.
  2. Log into your deployment and select an org and a space.
    $ cf login
    API endpoint: https://api.YOUR-SYSTEM-DOMAIN
  3. List the Marketplace services and locate the Cassandra On-Demand Service.

    $ cf marketplace
    Getting services from marketplace in org example / space development as

    service plans description cassandra-on-demand single_node Apache Cassandra On-Demand

  4. Create an instance of the Apache Cassandra On-Demand Service. Currently only single_node service plan is supported.

    $ cf create-service cassandra-on-demand single_node YOUR-SERVICE-INSTANCE
    Creating service instance YOUR-SERVICE-INSTANCE in org example / space development as
  5. Before binding the app, first check that the service was created. You can do this by using: cf service INSTANCE_NAME.

  6. Bind your application to the service instance.

    $ cf bind-service YOUR-APP YOUR-SERVICE-INSTANCE
    Binding service YOUR-SERVICE-INSTANCE to app YOUR-APP in org example / space development as
    TIP: Use 'cf restage YOUR-APP' to ensure your env variable changes take effect
  7. Restage the app for the binding to take effect.

    $ cf restage YOUR-APP
  8. Execute cf env YOUR-APP command. This step allows you to review environment variables that the Cassandra On-Demand Broker sets for your application. This environment variable has the following format:

       "cql_port": "9042",
       "hostname": "",
       "keyspace": "service_instance_keyspace",
       "password": "9a4a27ec-48d5-4faf-66a7-fd169c1aaf98",
       "thrift_port": "9160",
       "username": "cloud_admin"