Apache Cassandra (cluster)
Deploy Apache Cassandra, an open source, distributed NoSQL database designed to handle large amounts of data across multiple 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.
Cluster deploymentThe app is deployed with three or five Linode instances to create a distributed Apache Cassandra cluster, each with the plan type and size you select.
Each of these Linode instances will appear on your invoice as separate items.
1. Deploy Apache Cassandra cluster
clusterFollow the deployment instructions from the Get started section to configure the app, deploy it, and verify software installation.
For information on the app-specific configurations, see the Configuration options section.
Base distribution and plan
- Supported distribution: Ubuntu 24.04 LTS
- Recommended plan: All plan types and sizes can be used. For best results, use at least an 8GB Dedicated CPU or Shared Compute Instance.
Configuration options
Configure the required options to deploy your instance. For additional customization, add advanced options.
The table maps the Cloud Manager UI fields to their corresponding API/CLI keys (stackscript_data) required for automated deployments.
StackScript ID: 1350845
| UI field | API/CLI key | Description |
|---|---|---|
| Required options | ||
| Linode API token | token_password | A valid Linode API token used to deploy the additional Linode instances that make up this cluster. Follow Manage personal access tokens to get the token on your account with Read/Write access to Linodes. |
| Limited sudo user | sudo_username | Your preferred username for the limited sudo user, entered without any capital letters, spaces, or special characters. When adding a limited sudo user, the user is created with a strong generated password for your new Linode instance, and the account is assigned to the sudo group, which provides elevated permissions when running commands with the sudo prefix.Note: For easier and more secure access with the sudo user, add an account SSH key for the Cloud Manager user during deployment and select that user as an |
| Superuser for database cluster | db_superuser | The superuser name for the Cassandra database cluster. |
| SSL Information | sslheader | Set to Yes by default. This requires providing details for a self-signed TLS/SSL certificate, like country, town, organization, and email address. |
| Country or region | country_name | Applies to a self-signed TLS/SSL certificate. The country or region for you or your organization. When using the API/CLI, specify it as a two-letter ISO country or region code. |
| State or province | state_or_province_name | Applies to a self-signed TLS/SSL certificate. The state or province for you or your organization. |
| Locality | locality_name | Applies to a self-signed TLS/SSL certificate. The town or other locality for you or your organization. |
| Organization | organization_name | Applies to a self-signed TLS/SSL certificate. The name of your organization. |
| Email address | email_address | Applies to a self-signed TLS/SSL certificate. The email address you want to use for your certificate file. This email address may receive notifications about the state of your certificate, including when it's expired. |
| Cassandra cluster name | cluster_name | The name you want to use for this cluster deployment. |
| Number of clients connecting to Cassandra | client_count | The number of clients that will connect to the Cassandra cluster. Possible values are 1 through 20. |
| Advanced options | ||
| Cassandra version | cassandra_version | The version of Cassandra to install. Defaults to 4.1.5. |
| CA Common Name | ca_common_name | Applies to a self-signed TLS/SSL certificate. The common name for the self-signed Certificate Authority (CA). Defaults to Cassandra CA. |
| Cluster Settings | clusterheader | Set to Yes by default. Details of the cluster settings, including the cluster size and whether to add account SSH keys to all nodes. |
| Add Account SSH Keys to All Nodes | add_ssh_keys | When set to yes, any SSH Keys that are added to the root user account (in the SSH Keys section). They're also added to your limited user account on all deployed Linode instances. Possible values are: yes or no. Defaults to yes. |
| Cassandra cluster size | cluster_size | The number of Linode instances created as part of this cluster. Possible values are 3 or 5. Defaults to 3. |
Note: After the app deployment completes, the password for your limited sudo user is generated and stored in the
.credentialsfile in the home directory, along with application-specific passwords. Log in to your instance asrootthrough the Lish console or SSH, then runcat /home/$USERNAME/.credentialsto view its contents.
Use API, CLI, or Terraform
In addition to deploying the app to a new Linode instance via Cloud Manager, you can also use the Linode API, CLI, or Terraform. When running the operation, you need to provide the StackScript ID, supported Linux distribution, and app-specific fields along with the standard Linode deployment configurations.
Note: Generate a personal access token to authenticate your API, CLI, or Terraform requests.
curl --location 'https://api.linode.com/v4/linode/instances' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer abc123def456hij789klm' \
--data-raw '{
"region": "us-east",
"type": "g6-standard-4",
"image": "linode/ubuntu24.04",
"label": "my-cassandra-cluster-one-click-app",
"root_pass": "@C0mpl3x#P@ssw0rd",
"stackscript_id": 1350845,
"stackscript_data": {
"token_password": "abc123def456hij789klm",
"sudo_username": "jsmith",
"db_superuser": "jsmith-admin",
"country_name": "US",
"state_or_province_name": "Massachusetts",
"locality_name": "Cambridge",
"organization_name": "Akamai Technologies",
"email_address": "jsmith@example.com",
"cluster_name": "my-cluster",
"client_count": "5"
}
}'linode-cli linodes create \
--region us-east \
--type g6-standard-4 \
--label my-cassandra-cluster-one-click-app \
--image linode/ubuntu24.04 \
--root_pass @C0mpl3x#P@ssw0rd \
--stackscript_id 1350845 \
--stackscript_data '{"token_password":"abc123def456hij789klm", "sudo_username":"jsmith", "db_superuser":"jsmith-admin", "country_name":"US", "state_or_province_name":"Massachusetts", "locality_name":"Cambridge", "organization_name":"Akamai Technologies", "email_address":"jsmith@example.com", "cluster_name":"my-cluster", "client_count":"5"}'resource "linode_instance" "my-linode" {
region = "us-east"
type = "g6-standard-4"
label = "my-cassandra-cluster-one-click-app"
image = "linode/ubuntu24.04"
root_pass = "@C0mpl3x#P@ssw0rd"
stackscript_id = 1350845
stackscript_data = {
"token_password" = "abc123def456hij789klm"
"sudo_username" = "jsmith"
"db_superuser" = "jsmith-admin"
"country_name" = "US"
"state_or_province_name" = "Massachusetts"
"locality_name" = "Cambridge"
"organization_name" = "Akamai Technologies"
"email_address" = "jsmith@example.com"
"cluster_name" = "my-cluster"
"client_count" = "5"
}
}2. Connect to Cassandra
This 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.
You can find both certificates and keystores on every node in the /etc/cassandra/ssl directory. Only the first Cassandra server will have client certificates. This app also creates the specified number of client certificates so that applications can connect to the Cassandra cluster.
Connect to Cassandra with cqlsh that uses client or server certificates:
-
You need four components to connect to the cluster:
- Username and password generated during deployment. You can find the credentials in
/home/$SUDO_USER/.credentials, where$SUDO_USERis your sudo user created during deployment. - Client certificate
- Client key
- CA certificate
- Username and password generated during deployment. You can find the credentials in
-
On the client node, create the
/home/$SUDO_USER/cassandra_ssldirectory, where$SUDO_USERis your sudo user created during deployment. -
From the first Cassandra node, securely transfer these three files to the
/home/$SUDO_USER/cassandra_ssldirectory on the client node:/etc/cassandra/ssl/cert/client1.crt/etc/cassandra/ssl/key/client1.key/etc/cassandra/ssl/ca/ca.crt
-
Create a Cassandra resource file to use our client certificate. Create the
/home/$SUDO_USER/.cassandradirectory, in which you add acqlshrcfile with this 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 -
Connect to one of the Cassandra servers with
cqlsh, replacing192.168.139.160with the private IP address of one of the Cassandra nodes andsuperuserwith the Cassandra database user you provided when deploying the cluster.cqlsh 192.168.139.160 -u superuser --ssl -
Once you're connected, enter the password from
/home/$SUDO_USER/.credentialsat 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.
Additional resources
For more information about the installed packages, see their official documentation.
Note that we can't vouch for the accuracy or timeliness of externally hosted resources.
Updated 19 days ago
