Deployment guide

Apache Cassandra

Overview

This guide shows how to deploy and configure Apache Cassandra on Linux from a SecureAnyCloud AMI on AWS Marketplace. Apache Cassandra is a highly scalable, distributed NoSQL database that handles large volumes of data across multiple servers with no single point of failure.

What you get:

  • Apache Cassandra 4.0.4 with CQL native transport on port 9042
  • Java runtime environment
  • Dedicated data volume at /var/lib/cassandra
  • Systemd service for automatic startup on boot
  • OS package update script for keeping the system current
  • AWS CLI v2 for AWS service integration
  • Systems Manager Agent (SSM) for remote management
  • CloudWatch Agent for monitoring
  • Latest security patches applied at build time
  • 24/7 SecureAnyCloud support with guaranteed 24 hour response SLA

Prerequisites

Before you launch this AMI, make sure you have:

  • An active AWS account
  • An active subscription to the Apache Cassandra listing on AWS Marketplace
  • An EC2 key pair for SSH access
  • Familiarity with EC2 instance management and SSH

Recommended instance type: m5.large (2 vCPU, 8 GB RAM) or larger. The minimum requirements are 1 vCPU, 1 GB RAM and 20 GB of disk space. Cassandra benefits significantly from more memory and CPU for production workloads.

1

Launch the AMI

  • Open AWS Marketplace and search for "Apache Cassandra SecureAnyCloud".
  • Choose Continue to Subscribe, accept the terms, then choose Continue to Configuration.
  • Choose your Region and Software Version.
  • Choose Continue to Launch.
  • Choose Launch through EC2 for full control over instance configuration.
  • Choose your instance type (m5.large is recommended).
  • Configure storage: 20 GB gp3 minimum for the root volume. Use larger volumes for production data.
  • Configure your Security Group with these inbound rules:

Port Protocol Source Purpose

22 TCP Your IP SSH access

7199 TCP Your IP JMX monitoring port

7000 TCP VPC only Internode communication

9042 TCP Your IP CQL native transport port

Important: Allow ports 7000 and 7199 only within your VPC, for cluster communication and monitoring. Restrict port 9042 to trusted application servers or your IP address.

  • Choose your EC2 key pair and launch the instance.
2

Connect via SSH

When your instance is running and has passed both status checks (2/2), connect over SSH:

ssh -i your-key.pem ec2-user@<public-ip-address>

To switch to the root user:

sudo su -

Important: Wait until the instance reaches 2/2 successful status checks before you connect. Early connection attempts can fail with permission denied errors.

3

Verify that Cassandra is running

Check the status of the Cassandra node:

nodetool status

Expected output:

Datacenter: datacenter1 ======================== Status=Up/Down |/ State=Normal/Leaving/Joining/Moving -- Address Load Tokens Owns (effective) Host ID Rack UN 127.0.0.1 69.05 KiB 16 100.0% bb9d3091-c1e0-4ed2-92b4-2897099aba7d rack1

The UN status indicates the node is Up and in a Normal state.

4

Connect with the CQL shell

Start the interactive CQL shell:

cqlsh

Expected output:

Connected to Test Cluster at 127.0.0.1:9042 [cqlsh 6.0.0 | Cassandra 4.0.4 | CQL spec 3.4.5 | Native protocol v5] Use HELP for help. cqlsh>
5

Create a keyspace and table

Create a keyspace:

CREATE KEYSPACE my_app WITH replication = { 'class': 'SimpleStrategy', 'replication_factor': 1 };

Use the keyspace:

USE my_app;

Create a table:

CREATE TABLE users ( user_id UUID PRIMARY KEY, name text, email text, created_at timestamp );

Insert data:

INSERT INTO users (user_id, name, email, created_at) VALUES (uuid(), 'John Doe', 'john@example.com', toTimestamp(now()));

Query data:

SELECT * FROM users;

Type EXIT to leave the CQL shell.

Server Components

Component Install Path

Apache Cassandra /etc/cassandra

Java /bin/java

Note: The automatic OS package update script can update component versions on first boot.

Filesystem Layout

Mount Point Size Description

/ 38 GB Root filesystem

/boot 2 GB Operating system kernel files

/var/lib/cassandra 9.8 GB Apache Cassandra data directory

Key Cassandra directories:

Directory Purpose

/etc/cassandra Configuration files

/etc/cassandra/cassandra.yaml Main configuration file

/var/lib/cassandra Data, commitlog, and saved caches

/var/lib/cassandra/data SSTable data files

/var/lib/cassandra/commitlog Write ahead log

/var/log/cassandra Cassandra log files

Managing the Cassandra Service

Systemd manages Cassandra, and the service starts automatically on boot.

Check service status:

systemctl status cassandra

Stop Cassandra:

systemctl stop cassandra

Start Cassandra:

systemctl start cassandra

Restart Cassandra:

systemctl restart cassandra

Check node status with nodetool:

nodetool status nodetool info nodetool describecluster

Scripts and Log Files

Script/Log Path Description

initial_boot_update.sh /stage/scripts Updates the OS with the latest packages on first boot

initial_boot_update.log /stage/scripts Output log for the boot update script

On Startup

An OS package update script runs on first boot to bring the image fully up to date. To disable it, remove the script and its crontab entry:

rm -f /stage/scripts/initial_boot_update.sh crontab -e
# Delete the following line, save and exit: @reboot /stage/scripts/initial_boot_update.sh

Troubleshooting

Cassandra fails to start

  • Check service status: systemctl status cassandra
  • Review logs: tail -f /var/log/cassandra/system.log
  • Verify disk space: df -h /var/lib/cassandra
  • Check JVM heap settings in /etc/cassandra/cassandra-env.sh

nodetool status shows DN (Down/Normal)

  • Restart Cassandra: systemctl restart cassandra
  • Check for errors in /var/log/cassandra/system.log
  • Verify JMX port 7199 is not blocked

CQL connection refused on port 9042

  • Verify Cassandra is running: systemctl status cassandra
  • Check that native_transport_port is set to 9042 in cassandra.yaml
  • Verify the security group allows port 9042

High memory usage

  • Cassandra uses significant heap memory by design.
  • Adjust the heap size in /etc/cassandra/cassandra-env.sh.
  • Consider moving to a memory-optimized instance type (r5, r6i).

Security Recommendations

  • Restrict port access: Only allow CQL port 9042 from trusted application servers
  • Enable authentication: Configure authenticator: PasswordAuthenticator in cassandra.yaml
  • Enable authorization: Configure authorizer: CassandraAuthorizer in cassandra.yaml
  • Encrypt client connections: Enable SSL/TLS for client to node communication
  • Encrypt cluster communication: Enable internode encryption for port 7000
  • Change default credentials: If authentication is enabled, create new users and remove the default cassandra user
  • Keep Cassandra updated: Apply security patches when available
  • Monitor with JMX: Use nodetool and JMX for monitoring cluster health

Support

If you have a problem with this product, contact SecureAnyCloud support:

  • Email: sales@secureanycloud.com
  • Website: secureanycloud.com
  • Support hours: 24/7 with guaranteed 24 hour response SLA

Deploy on AWS

Launch Apache Cassandra with 24/7 support from SecureAnyCloud.

View on Marketplace

Need Help?

Our support team is available 24/7.

sales@secureanycloud.com

Deploy on AWS

Launch Apache Cassandra with 24/7 support from SecureAnyCloud.

View on Marketplace

Need Help?

Our support team is available 24/7.

sales@secureanycloud.com