Install Cassandra on Linux
The BEST platform for Cassandra - Perfect for development AND production!
🐧 Linux: The BEST Platform for Cassandra!
✅ Why Linux is #1 for Cassandra
- 🚀 Best Performance: 30-50% faster than Windows/macOS
- 🏭 Production Standard: 99% of Cassandra deployments use Linux
- 💰 Free & Open Source: No licensing costs
- 🛠️ Superior Tools: All monitoring/management tools built for Linux
- ⚡ Better Memory Management: JVM optimized for Linux
- 📊 Kernel Tuning: Fine-grained performance optimization
- 🔒 Stable & Secure: Battle-tested in production
💼 Who Uses Linux for Cassandra?
- 📺 Netflix: Ubuntu 20.04 LTS - thousands of nodes
- 📱 Instagram: CentOS 7 - petabytes of data
- 💳 Apple: RHEL 8 - 75,000+ nodes!
- 🎵 Spotify: Debian - millions of queries/second
- 🛒 eBay: Ubuntu - multi-datacenter clusters
🎯 Perfect For:
- ✅ Production Deployments: The ONLY recommended OS
- ✅ Development: Environment matches production
- ✅ Learning: Industry-standard environment
- ✅ Performance Testing: Accurate benchmarks
- ✅ Enterprise: Support from DataStax/vendors
🚀 Let's install Cassandra the RIGHT way - on Linux!
🎯 Choose Your Linux Distribution
Different installation methods for different distros.
Ubuntu / Debian
Most Popular
- ✅ Easy setup
- ✅ APT package manager
- ✅ Great community support
- ✅ LTS versions
- 📦 Package install or manual
RHEL / CentOS / Rocky
Enterprise Choice
- ✅ Enterprise support
- ✅ YUM/DNF package manager
- ✅ Rock-solid stability
- ✅ Long support cycles
- 📦 Package install or manual
Manual Installation
Any Linux Distro
- ⚙️ Full control
- ⚙️ Works on any distro
- ⚙️ Multiple versions
- ⚙️ Custom configuration
- 📦 Tarball installation
Which Should You Choose?
Choose Ubuntu if:
- You want the easiest installation
- You're new to Linux
- You want the latest packages
- You're setting up a dev environment
Choose RHEL/CentOS if:
- You need enterprise support
- You work in a corporate environment
- Your company standardizes on Red Hat
- You need maximum stability
Use Manual Installation if:
- You're on a less common distro (Arch, Gentoo, etc.)
- You need multiple Cassandra versions
- You want complete control
🟠 Method 1: Ubuntu / Debian Installation
Easy installation using APT package manager.
Supported Versions
- Ubuntu: 20.04 LTS, 22.04 LTS, 24.04 LTS
- Debian: 11 (Bullseye), 12 (Bookworm)
- Not recommended: Non-LTS versions
Install Java 11
Add Apache Cassandra Repository
Install Cassandra
Start Cassandra Service
Verify Installation
Ubuntu/Debian Installation Complete!
Important Locations:
- Config:
/etc/cassandra/cassandra.yaml - Data:
/var/lib/cassandra/data - Logs:
/var/log/cassandra/system.log - Binaries:
/usr/sbin/cassandra
Useful Commands:
sudo systemctl start cassandra- Startsudo systemctl stop cassandra- Stopsudo systemctl restart cassandra- Restartsudo systemctl status cassandra- Check status
🔴 Method 2: RHEL / CentOS / Rocky Installation
Enterprise-grade installation using YUM/DNF package manager.
Supported Versions
- RHEL: 8, 9
- CentOS Stream: 8, 9
- Rocky Linux: 8, 9
- AlmaLinux: 8, 9
Install Java 11
Add Apache Cassandra Repository
Install Cassandra
Start Cassandra Service
Configure Firewall
RHEL/CentOS has firewalld enabled by default. Open required ports:
RHEL/CentOS Installation Complete!
Important Locations:
- Config:
/etc/cassandra/default.conf/cassandra.yaml - Data:
/var/lib/cassandra/data - Logs:
/var/log/cassandra/system.log
📦 Method 3: Manual Installation (Any Linux)
Works on any Linux distribution.
Install Java
Download and Extract Cassandra
Create Data Directories
Configure Environment Variables
Start Cassandra
⚙️ Configuration
Essential configuration for optimal performance.
Edit cassandra.yaml
Key settings to review:
Configure JVM Heap
Edit JVM options for your server's RAM:
System Limits (CRITICAL!)
Linux requires these limits for Cassandra:
🔧 Systemd Service Setup (Manual Install)
Create systemd service for manual installations.
Create Service File
Enable and Start Service
✅ Verify Installation
Make sure everything works!
Check Cassandra Status
Connect and Test
🏭 Production Best Practices
Essential tips for production deployments!
💾 Use Separate Disks
Best Practice: Separate commit log from data
Mount commit log on separate SSD for best performance!
🔒 Disable Swap
Critical: Swapping kills performance
⚡ Kernel Tuning
Optimize: Network and I/O settings
📊 Setup Monitoring
Essential: Monitor your cluster
- Prometheus + Grafana: Industry standard
- DataStax OpsCenter: Enterprise option
- JMX monitoring: Enable port 7199
🔄 Enable Backups
Critical: Regular snapshots
🔧 Common Issues & Solutions
Fix common Linux installation problems!
❌ "cassandra: command not found"
Problem: PATH not set
Solution:
❌ "Cannot allocate memory"
Problem: Heap too large or limits too low
Solution:
- Reduce heap in jvm-server.options
- Check system limits:
ulimit -a - Increase limits in /etc/security/limits.conf
❌ Service fails to start
Check logs:
❌ "Too many open files"
Problem: File descriptor limit too low
Solution:
Need Help?
Check these resources:
- 📝 Logs: /var/log/cassandra/system.log
- 📊 Status:
nodetool status,nodetool info - 💬 Community: Apache Cassandra mailing list
- 📚 Docs: https://cassandra.apache.org/doc/
- 🐳 Alternative: Try Docker if having issues!
Responsive Ad