Create a Linode account to try this guide with a $ credit.
This credit will be applied to any valid services used during your first  days.

Cluster Deployment Architecture

Create a highly available Apache Cassandra cluster through the Linode Marketplace. Apache Cassandra is an open-source, distributed NoSQL database management system designed for handling large amounts of data across many commodity servers, providing high availability with no single point of failure. Cassandra offers robust support for clusters with asynchronous masterless replication, allowing low-latency operations for all clients.

Deploying a Marketplace App

The Linode Marketplace lets you easily deploy software on a Compute Instance using Cloud Manager. See Get Started with Marketplace Apps for complete steps.

  1. Log in to Cloud Manager and select the Marketplace link from the left navigation menu. This displays the Linode Create page with the Marketplace tab pre-selected.

  2. Under the Select App section, select the app you would like to deploy.

  3. Complete the form by following the steps and advice within the Creating a Compute Instance guide. Depending on the Marketplace App you selected, there may be additional configuration options available. See the Configuration Options section below for compatible distributions, recommended plans, and any additional configuration options available for this Marketplace App.

  4. Click the Create Linode button. Once the Compute Instance has been provisioned and has fully powered on, wait for the software installation to complete. If the instance is powered off or restarted before this time, the software installation will likely fail.

To verify that the app has been fully installed, see Get Started with Marketplace Apps > Verify Installation. Once installed, follow the instructions within the Getting Started After Deployment section to access the application and start using it.

Note
Estimated deployment time: Your Apache Cassandra cluster should be fully installed within 10-15 minutes after the Compute Instance has finished provisioning.

Configuration Options

  • Supported distributions: Ubuntu 22.04 LTS
  • Suggested minimum plan: All plan types and sizes can be used. For best results, a minimum of 8GB Dedicated CPU or Shared Compute Instance is recommended.

Apache Cassandra Options

  • Linode API Token: The provisioner node uses an authenticated API token to create the additional components to the cluster. This is required to fully create the Apache Cassandra cluster.

Limited Sudo User

You need to fill out the following fields to automatically create a limited sudo user, with a strong generated password for your new Compute Instance. This account will be assigned to the sudo group, which provides elevated permissions when running commands with the sudo prefix.

  • Limited sudo user: Enter your preferred username for the limited user. No Capital Letters, Spaces, or Special Characters.

    Locating The Generated Sudo Password

    A password is generated for the limited user and stored in a .credentials file in their home directory, along with application specific passwords. This can be viewed by running: cat /home/$USERNAME/.credentials

    For best results, add an account SSH key for the Cloud Manager user that is deploying the instance, and select that user as an authorized_user in the API or by selecting that option in Cloud Manager. Their SSH pubkey will be assigned to both root and the limited user.

  • Disable root access over SSH: To block the root user from logging in over SSH, select Yes. You can still switch to the root user once logged in, and you can also log in as root through Lish.

    Accessing The Instance Without SSH
    If you disable root access for your deployment and do not provide a valid Account SSH Key assigned to the authorized_user, you will need to login as the root user via the Lish console and run cat /home/$USERNAME/.credentials to view the generated password for the limited user.

Warning
Do not use a double quotation mark character (") within any of the App-specific configuration fields, including user and database password fields. This special character may cause issues during deployment.
  • Cassandra Database User: Enter your database super username for the Cassandra cluster.

  • Number of clients connecting to Cassandra: The number of clients that will be connecting to the cluster. The application will create SSL certificates for your clients that need to connect to the cluster. The number of clients should be an integer equal or greater than 1.

  • Cassandra cluster size: The size of the Cassandra cluster

  • Country or Region: Enter the country or region for you or your organization.

  • State or Province: Enter the state or province for you or your organization.

  • Locality: Enter the town or other locality for you or your organization.

  • Organization: Enter the name of your organization.

  • Email Address: Enter the email address you wish to use for your certificate file.

Getting Started After Deployment

This Marketplace App creates a 3-5 node cluster using Apache Cassandra. Authentication to the cluster is secured via a user-supplied username. The default cassandra database role is removed and superseded by the new user role provided by the client. In addition, cluster communication is secured via SSL/TLS with self-signed keystores.

Both certificates and keystores can be found on every node in the /etc/cassandra/ssl directory. Only the first Cassandra server will have client certificates. This playbook also creates n amount of client certificates so that applications can connect to the Cassandra cluster.

Connecting to Cassandra

Connect to Cassandra using cqlsh using client or server certificates. You will need 4 components to connect to the cluster:

  • Username and password created by the playbook. You can find the credentials in /home/$SUDO_USER/.credentials, where $SUDO_USER is your sudo user created during deployment.
  • Client certificate
  • Client key
  • CA certificate
  1. On the client node, create the /home/$SUDO_USER/cassandra_ssl directory, where $SUDO_USER is your sudo user created during deployment.

  2. From the first Cassandra node, securely transfer the following files and directories: /etc/cassandra/ssl/cert/client1.crt, /etc/cassandra/ssl/key/client1.key, and /etc/cassandra/ssl/ca/ca.crt to the /home/$SUDO_USER/cassandra_ssl directory on the client node.

  3. Create a Cassandra resource file to use our client certificate. Create the /home/$SUDO_USER/.cassandra directory. In the .cassandra directory, create a cqlshrc file with the following content:

    [connection]
    ssl = true
    factory = cqlshlib.ssl.ssl_transport_factory
    [ssl]
    certfile = /home/$SUDO_USER/cassandra_ssl/ca.crt
    userkey = /home/$SUDO_USER/cassandra_ssl/client1.key
    usercert = /home/$SUDO_USER/cassandra_ssl/client1.crt
    validate = true
    
  4. Connect to one of the Cassandra servers using cqlsh:

    cqlsh 192.168.139.160 -u superuser --ssl

Replace 192.168.139.160 with the private IP address of one of the Cassandra nodes and superuser with the Cassandra database user you provided when deploying the cluster. Once you are connected, enter the password from /home/$SUDO_USER/.credentials at the prompt to authenticate to the cluster.

Connected to Cassandra Cluster at 192.168.139.160:9042
[cqlsh 6.1.0 | Cassandra 4.1.5 | CQL spec 3.4.6 | Native protocol v5]
Use HELP for help.
superadmin@cqlsh>

You can distribute the remainder of client certificates to the rest of the nodes.

Software Included

The Apache Cassandra Marketplace App installs the following software on your Linode:

SoftwareDescription
Apache CassandraOpen Source NoSQL Database.
UFWUncomplicated Firewall

Note
Currently, Linode does not manage software and systems updates for Marketplace Apps. It is up to the user to perform routine maintenance on software deployed in this fashion.

More Information

You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.

This page was originally published on


Your Feedback Is Important

Let us know if this guide was helpful to you.