Key Features of ScyllaDB
System Requirements
⚠️ Important: ScyllaDB is designed to maximize hardware utilization. NVMe SSDs are strongly recommended for production workloads due to ScyllaDB's high I/O requirements.
Resource Requirements
| Workload | RAM | CPU | Storage | RamNode Plan |
|---|---|---|---|---|
| Development/Testing | 4 GB | 2 vCPUs | 40 GB SSD | Premium 4GB |
| Light Production | 8 GB | 4 vCPUs | 80 GB NVMe | Premium 8GB |
| Standard Production | 16 GB | 8 vCPUs | 160 GB NVMe | Premium 16GB |
| High Performance | 32 GB+ | 16+ vCPUs | 500 GB+ NVMe | Premium 32GB+ |
Network Ports
| Port | Service | Description |
|---|---|---|
| 9042 | CQL | Native CQL client connections |
| 9142 | CQL SSL | Encrypted CQL connections |
| 7000 | Inter-node | Cluster communication |
| 7001 | Inter-node SSL | Encrypted cluster communication |
| 7199 | JMX | Monitoring and management |
| 10000 | REST API | ScyllaDB REST API |
| 9180 | Prometheus | Metrics endpoint |
Installation
sudo apt update && sudo apt upgrade -ysudo apt install -y apt-transport-https wget gnupg2 curl
sudo apt install -y openjdk-11-jre-headlessAdd ScyllaDB Repository
# Import the ScyllaDB GPG key
sudo mkdir -p /etc/apt/keyrings
sudo gpg --homedir /tmp --no-default-keyring --keyring /etc/apt/keyrings/scylladb.gpg \
--keyserver hkp://keyserver.ubuntu.com:80 --recv-keys d0a112e067426ab2
# Add the repository (Ubuntu 22.04)
sudo wget -O /etc/apt/sources.list.d/scylla.list \
http://downloads.scylladb.com/deb/debian/scylla-5.4.listsudo apt update
sudo apt install -y scyllaRun ScyllaDB Setup
ScyllaDB includes an automatic setup script that optimizes your system:
sudo scylla_setup
# The wizard will configure:
# - NTP synchronization
# - RAID setup (if applicable)
# - Filesystem optimization (XFS recommended)
# - Network settings
# - CPU pinning for optimal performance💡 Tip: For development, you can answer "no" to most optimization questions. For production, let the wizard optimize everything for maximum performance.
sudo systemctl start scylla-server
sudo systemctl enable scylla-server
# Check status
sudo systemctl status scylla-serverConfiguration
Edit the main configuration file at /etc/scylla/scylla.yaml:
sudo nano /etc/scylla/scylla.yamlEssential Configuration Options
| Parameter | Description | Example |
|---|---|---|
| cluster_name | Unique cluster identifier | 'RamNodeScylla' |
| listen_address | Node IP for inter-node | Your VPS private IP |
| rpc_address | IP for client connections | 0.0.0.0 |
| seeds | Seed nodes for discovery | IP of seed nodes |
| endpoint_snitch | Topology awareness | GossipingPropertyFileSnitch |
Single-Node Configuration
cluster_name: 'RamNodeDev'
num_tokens: 256
listen_address: localhost
rpc_address: localhost
seed_provider:
- class_name: org.apache.cassandra.locator.SimpleSeedProvider
parameters:
- seeds: "127.0.0.1"
# ScyllaDB-specific optimizations
developer_mode: true # Disable for production
experimental: trueProduction Configuration
cluster_name: 'RamNodeProd'
num_tokens: 256
listen_address: YOUR_PRIVATE_IP
rpc_address: 0.0.0.0
broadcast_rpc_address: YOUR_PUBLIC_IP
seed_provider:
- class_name: org.apache.cassandra.locator.SimpleSeedProvider
parameters:
- seeds: "SEED_NODE_IP"
endpoint_snitch: GossipingPropertyFileSnitch
# Disable developer mode for production
developer_mode: false
# Enable authentication
authenticator: PasswordAuthenticator
authorizer: CassandraAuthorizersudo systemctl restart scylla-server
# Wait for startup, then verify
sleep 30 && nodetool statusSecurity Hardening
Enable Authentication
After enabling PasswordAuthenticator in scylla.yaml:
# Restart ScyllaDB after config change
sudo systemctl restart scylla-server
# Log in with default credentials
cqlsh localhost -u cassandra -p cassandra
# Create new superuser
CREATE ROLE admin WITH PASSWORD = 'YourSecurePassword123!'
AND SUPERUSER = true AND LOGIN = true;
# Exit and log in as new user
EXIT;
cqlsh localhost -u admin -p 'YourSecurePassword123!'
# Disable default cassandra user
ALTER ROLE cassandra WITH PASSWORD = 'RandomLongString123!'
AND SUPERUSER = false;Firewall Configuration
# Enable UFW
sudo ufw enable
# Allow SSH
sudo ufw allow 22/tcp
# CQL native transport (restrict to app servers)
sudo ufw allow from YOUR_APP_IP to any port 9042
# Inter-node communication (for clusters)
sudo ufw allow from CLUSTER_SUBNET to any port 7000
sudo ufw allow from CLUSTER_SUBNET to any port 7001
# Prometheus metrics (restrict to monitoring server)
sudo ufw allow from MONITORING_IP to any port 9180
# Verify rules
sudo ufw status verboseEnable TLS Encryption
# Create certificate directory
sudo mkdir -p /etc/scylla/certs
# Generate self-signed certificate (for testing)
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-keyout /etc/scylla/certs/scylla.key \
-out /etc/scylla/certs/scylla.crt \
-subj "/CN=scylla.yourdomain.com"
# Set proper permissions
sudo chown scylla:scylla /etc/scylla/certs/*
sudo chmod 600 /etc/scylla/certs/scylla.keyclient_encryption_options:
enabled: true
certificate: /etc/scylla/certs/scylla.crt
keyfile: /etc/scylla/certs/scylla.key
require_client_auth: false
server_encryption_options:
internode_encryption: all
certificate: /etc/scylla/certs/scylla.crt
keyfile: /etc/scylla/certs/scylla.key💡 Production Tip: Use certificates from a trusted Certificate Authority for production deployments.
Multi-Node Cluster Setup
For high availability and performance, deploy ScyllaDB across multiple VPS nodes.
Configure Seed Nodes
On all nodes, update scylla.yaml with the seed node addresses:
cluster_name: 'RamNodeCluster'
listen_address: THIS_NODE_PRIVATE_IP
rpc_address: 0.0.0.0
broadcast_rpc_address: THIS_NODE_PUBLIC_IP
seed_provider:
- class_name: org.apache.cassandra.locator.SimpleSeedProvider
parameters:
- seeds: "SEED_NODE_1_IP,SEED_NODE_2_IP"
endpoint_snitch: GossipingPropertyFileSnitchsudo nano /etc/scylla/cassandra-rackdc.properties
# Add:
dc=ramnode-dc1
rack=rack1# Start ScyllaDB on each node
sudo systemctl start scylla-server
# Check cluster status from any node
nodetool statusRecommended Cluster Topology
| Nodes | Replication Factor | Use Case |
|---|---|---|
| 3 nodes | RF=3 | Standard production |
| 5 nodes | RF=3 | High availability |
| 6+ nodes | RF=3 | High throughput |
Basic Operations
Connecting with CQL Shell
# Local connection
cqlsh localhost
# Authenticated connection
cqlsh localhost -u admin -p 'YourPassword'
# Remote connection
cqlsh YOUR_VPS_IP 9042 -u admin -p 'YourPassword'Creating a Keyspace
-- Create keyspace with replication
CREATE KEYSPACE myapp WITH replication = {
'class': 'NetworkTopologyStrategy',
'ramnode-dc1': 3
};
-- Use the keyspace
USE myapp;
-- Create a table
CREATE TABLE users (
user_id UUID PRIMARY KEY,
email TEXT,
name TEXT,
created_at TIMESTAMP
);
-- Insert data
INSERT INTO users (user_id, email, name, created_at)
VALUES (uuid(), 'user@example.com', 'John Doe', toTimestamp(now()));
-- Query data
SELECT * FROM users;Cluster Management Commands
# Check cluster status
nodetool status
# View node information
nodetool info
# Check compaction status
nodetool compactionstats
# Repair a node
nodetool repair
# Decommission a node
nodetool decommissionBackup and Recovery
Snapshot Backup
# Create snapshot of all keyspaces
nodetool snapshot
# Create snapshot of specific keyspace
nodetool snapshot -t backup_$(date +%Y%m%d) myapp
# Find snapshot location
ls -la /var/lib/scylla/data/myapp/*/snapshots/Automated Backup Script
#!/bin/bash
DATE=$(date +%Y%m%d_%H%M%S)
BACKUP_DIR="/backup/scylla"
KEYSPACES="myapp"
LOG_FILE="/var/log/scylla-backup.log"
echo "[$DATE] Starting backup..." >> $LOG_FILE
# Create snapshot
nodetool snapshot -t backup_$DATE $KEYSPACES
# Copy snapshots to backup directory
for ks in $KEYSPACES; do
for table_dir in /var/lib/scylla/data/$ks/*/; do
table=$(basename $table_dir)
snapshot_dir="$table_dir/snapshots/backup_$DATE"
if [ -d "$snapshot_dir" ]; then
mkdir -p "$BACKUP_DIR/$DATE/$ks/$table"
cp -r "$snapshot_dir"/* "$BACKUP_DIR/$DATE/$ks/$table/"
fi
done
done
# Clear old snapshots
nodetool clearsnapshot -t backup_$DATE
# Remove backups older than 7 days
find $BACKUP_DIR -type d -mtime +7 -exec rm -rf {} \; 2>/dev/null
echo "[$DATE] Backup completed" >> $LOG_FILEchmod +x /opt/scripts/scylla-backup.sh
sudo crontab -e
# Add this line (runs daily at 3 AM):
0 3 * * * /opt/scripts/scylla-backup.shRestore from Snapshot
# Stop ScyllaDB
sudo systemctl stop scylla-server
# Clear existing data
sudo rm -rf /var/lib/scylla/data/myapp/*
# Copy snapshot data back
sudo cp -r /backup/scylla/YYYYMMDD_HHMMSS/myapp/* /var/lib/scylla/data/myapp/
# Fix ownership
sudo chown -R scylla:scylla /var/lib/scylla/data/
# Start ScyllaDB
sudo systemctl start scylla-server
# Rebuild secondary indexes if needed
nodetool rebuild_index myapp users users_email_idxMonitoring
Built-in Prometheus Metrics
ScyllaDB exposes Prometheus metrics on port 9180:
scrape_configs:
- job_name: 'scylla'
static_configs:
- targets: ['localhost:9180']
honor_labels: true
metrics_path: /metricsKey Metrics to Monitor
scylla_storage_proxy_coordinator_read_latency- Read latencyscylla_storage_proxy_coordinator_write_latency- Write latencyscylla_reactor_utilization- CPU utilization per shardscylla_memory_allocated_memory- Memory usagescylla_compaction_manager_compactions- Compaction activity
ScyllaDB Monitoring Stack
ScyllaDB provides a pre-built monitoring stack:
# Clone the monitoring stack
git clone https://github.com/scylladb/scylla-monitoring.git
cd scylla-monitoring
# Start the stack (includes Grafana dashboards)
./start-all.sh -s YOUR_SCYLLA_IP:9180
# Access Grafana at http://localhost:3000
# Default credentials: admin/adminTroubleshooting
Service Won't Start
# Check service status
sudo systemctl status scylla-server
# View detailed logs
sudo journalctl -u scylla-server -n 100 --no-pager
# Check ScyllaDB logs
sudo tail -100 /var/log/scylla/scylla.logNode Not Joining Cluster
# Test connectivity to seed nodes
nc -zv SEED_NODE_IP 7000
nc -zv SEED_NODE_IP 9042
# Check gossip status
nodetool gossipinfo
# Verify cluster name matches on all nodes
grep cluster_name /etc/scylla/scylla.yamlHigh Latency Issues
# Check compaction status
nodetool compactionstats
# View thread pool status
nodetool tpstats
# Check for dropped messages
nodetool netstats
# View per-shard CPU utilization
scylla_dev_mode_enable=1 scylla --developer-mode=true --helpCommon Commands Reference
| Command | Purpose |
|---|---|
| nodetool status | Cluster status overview |
| nodetool info | Node information |
| nodetool ring | Token ring information |
| nodetool repair | Anti-entropy repair |
| nodetool cleanup | Remove unwanted data |
| nodetool flush | Flush memtables to disk |
Deployment Complete!
You've successfully deployed ScyllaDB on your RamNode VPS. With its shard-per-core architecture and automatic tuning, ScyllaDB delivers consistent low-latency performance at scale.
