Getting Started

Getting started with Cassandra

Getting started with a test instance of the DC/OS Apache Cassandra service is straightforward.

Prerequisites

  • Depending on your security mode in Enterprise DC/OS, you may need to provision a service account before installing. Only someone with superuser permission can create the service account.
    • strict security mode requires a service account.
    • permissive security mode a service account is optional.
    • disabled security mode does not require a service account.
  • Your cluster must have at least three private nodes.

Install a basic cluster

To start a basic test cluster with three Apache Cassandra nodes, run the following command on the DC/OS CLI.

$ dcos package install cassandra

This command creates a new instance with the default name cassandra. Two instances cannot share the same name, so installing additional instances beyond the default instance requires customizing the name at install time for each additional instance.

All dcos cassandra CLI commands have a --name argument allowing you to specify which instance to query. If you do not specify a service name, the CLI assumes a default value matching the package name, cassandra. The default value for --name can be customized via the DC/OS CLI configuration:

$ dcos cassandra --name=cassandra <cmd>

Alternatively, you can install from the DC/OS web interface. If you install Apache Cassandra from the DC/OS web interface, the dcos cassandra CLI commands are not automatically installed to your workstation. They may be manually installed using the DC/OS CLI:

dcos package install cassandra --cli

After running the package install command, the service will begin installing.

Enterprise DC/OS installation

Depending on the security mode of the Enterprise DC/OS cluster, Enterprise DC/OS users may need to create a custom .json file and use it to install Apache Cassandra.

Create a Configuration File

Create a custom configuration file that will be used to install Apache Cassandra, and save it as config.json. Specify the service account (<service_account_id>) and a secret path (cassandra/<secret-name>) .

{
  "service": {
    "service_account": "<service_account_id>",
    "service_account_secret": "cassandra/<secret-name>"
  }
}

Installing with a custom config file

Use the custom configuration file you just created to install Apache Cassandra with this command:

dcos package install --options=config.json cassandra

Service Deployment

To monitor the deployment of your test instance, install the package cli (see command above) and run the command:

dcos cassandra plan show deploy

Once the deploy plan has a status of Complete, the service is fully deployed.

Service Discovery

To connect a client, query the service for its endpoints.

dcos cassandra endpoints

Select an endpoint from the list to see the available connections.

dcos cassandra endpoints <endpoint>

Working with the Service

Using the endpoint information, you can connect a client to the service from within the DC/OS cluster (for example, a Marathon app running a client application). See the other sections of the documentation for more details on configuration, operation, and service capabilities.