nodetool disablebackup
Disables incremental backup on the node.
Synopsis
Section titled “Synopsis”nodetool [connection_options] disablebackupSee connection options for connection options.
Description
Section titled “Description”nodetool disablebackup disables incremental backup mode on the node. Once disabled, Cassandra stops creating hard links to newly flushed SSTables. Existing backup files in the backups directory are not removed—they must be cleaned up manually.
Incremental backup creates hard links to new SSTables when they are created (during memtable flush, compaction, and other SSTable-producing operations), providing continuous backup capability. Disabling this feature stops the automatic link creation process.
Non-Persistent Setting
This setting is applied at runtime only and does not persist across node restarts. After a restart, incremental backup reverts to the incremental_backups setting in cassandra.yaml (default: false).
To make the change permanent, update cassandra.yaml:
incremental_backups: falseBehavior
Section titled “Behavior”When incremental backup is disabled:
- No new hard links are created for flushed SSTables
- Existing backup files remain in place (not deleted)
- Disk space used by existing backups is retained
- The change takes effect immediately
- The setting reverts to the
cassandra.yamlconfiguration on restart
Examples
Section titled “Examples”Basic Usage
Section titled “Basic Usage”nodetool disablebackupVerify Disabled
Section titled “Verify Disabled”nodetool disablebackupnodetool statusbackup# Expected output: not runningWhen to Use
Section titled “When to Use”Disk Space Management
Section titled “Disk Space Management”When backup files consume too much space:
# Check current backup sizesdu -sh /var/lib/cassandra/data/*/*/backups/# Total: 150GB
# Stop new backupsnodetool disablebackup
# Copy existing backups to external storagersync -av /var/lib/cassandra/data/*/*/backups/ /backup/server/
# Clean up local backupsfind /var/lib/cassandra/data -path "*/backups/*" -type f -delete
# Verify cleanupdu -sh /var/lib/cassandra/data/*/*/backups/Temporary Maintenance Disable
Section titled “Temporary Maintenance Disable”During maintenance operations:
# Disable during heavy operationsnodetool disablebackup
# Perform maintenance (repair, compaction, etc.)nodetool repair -pr my_keyspace
# Re-enable after maintenancenodetool enablebackup
# Verifynodetool statusbackupSwitching Backup Strategy
Section titled “Switching Backup Strategy”When migrating to a different backup solution:
# Disable incremental backupnodetool disablebackup
# Clean up existing backup filesfind /var/lib/cassandra/data -path "*/backups/*" -delete
# (Configure new backup solution)I/O Reduction
Section titled “I/O Reduction”During I/O-intensive operations:
# Disable to reduce I/O overheadnodetool disablebackup
# Perform I/O-intensive operationnodetool upgradesstables
# Re-enablenodetool enablebackupBefore Node Decommission
Section titled “Before Node Decommission”Remove unnecessary backup overhead before decommission:
# Disable backups (node is leaving)nodetool disablebackup
# Clean up backup filesfind /var/lib/cassandra/data -path "*/backups/*" -delete
# Proceed with decommissionnodetool decommissionImpact Assessment
Section titled “Impact Assessment”What Changes
Section titled “What Changes”| Aspect | Before Disable | After Disable |
|---|---|---|
| New backup links | Created on flush | Not created |
| Existing backups | Present | Still present |
| Disk overhead | Grows with flushes | No new growth |
| Recovery capability | Full incremental | Depends on existing files |
What Does NOT Change
Section titled “What Does NOT Change”- Existing backup files remain (must clean manually)
- Snapshots are unaffected
- Compaction behavior unchanged
- Normal data operations continue
Cleanup After Disable
Section titled “Cleanup After Disable”Disabling backup does not remove existing files:
Check Backup Size
Section titled “Check Backup Size”# Per-keyspace backup sizesdu -sh /var/lib/cassandra/data/*/*/backups/
# Total backup sizefind /var/lib/cassandra/data -path "*/backups/*" -type f -exec du -ch {} + | tail -1Copy Before Cleanup
Section titled “Copy Before Cleanup”# Back up to external storage firstrsync -av /var/lib/cassandra/data/*/*/backups/ /backup/final_incremental/Remove Backup Files
Section titled “Remove Backup Files”# Remove all backup files (careful!)find /var/lib/cassandra/data -path "*/backups/*" -type f -delete
# Or remove per-keyspacerm -rf /var/lib/cassandra/data/my_keyspace/*/backups/*
# Verify removalfind /var/lib/cassandra/data -path "*/backups/*" -type f | wc -l# Should be 0Workflow: Complete Backup Disable and Cleanup
Section titled “Workflow: Complete Backup Disable and Cleanup”#!/bin/bashecho "=== Disable Incremental Backup ==="echo ""
# 1. Check current stateecho "1. Current status: $(nodetool statusbackup)"
# 2. Check current backup sizeecho "2. Current backup size:"find /var/lib/cassandra/data -path "*/backups/*" -type f -exec du -ch {} + 2>/dev/null | tail -1
# 3. Disable backupecho "3. Disabling incremental backup..."nodetool disablebackup
# 4. Verify disabledecho "4. New status: $(nodetool statusbackup)"
# 5. Optional: Clean up existing backupsread -p "5. Remove existing backup files? (y/n): " cleanupif [ "$cleanup" = "y" ]; then echo " Removing backup files..." find /var/lib/cassandra/data -path "*/backups/*" -type f -delete echo " Done."fi
echo ""echo "=== Complete ==="Effects on Disk Space
Section titled “Effects on Disk Space”Hard Links Explained
Section titled “Hard Links Explained”When backup is enabled, SSTables have hard links in the backups directory:
SSTable: /data/keyspace/table/nb-1-big-Data.dbBackup: /data/keyspace/table/backups/nb-1-big-Data.db (both point to same disk blocks)After compaction removes the original SSTable:
- The backup file becomes the only reference
- Disk space is now exclusively used by backup
Space Recovery
Section titled “Space Recovery”To reclaim space after disabling:
# Check space used by backupsdu -sh /var/lib/cassandra/data/*/*/backups/
# Remove to reclaimfind /var/lib/cassandra/data -path "*/backups/*" -delete
# Verify space recovereddf -h /var/lib/cassandraRuntime vs Persistent Configuration
Section titled “Runtime vs Persistent Configuration”Runtime (Temporary)
Section titled “Runtime (Temporary)”nodetool disablebackup# Does not persist across restartPersistent (Permanent)
Section titled “Persistent (Permanent)”Edit cassandra.yaml:
incremental_backups: falseThen either restart or use nodetool:
# For immediate effect without restartnodetool disablebackupComparison
Section titled “Comparison”| Method | Effect | Persistence |
|---|---|---|
nodetool disablebackup | Immediate | Until restart |
cassandra.yaml: false | After restart | Permanent |
| Both | Immediate + permanent | Best practice |
Monitoring
Section titled “Monitoring”Verify Status
Section titled “Verify Status”nodetool statusbackup# Expected: not runningMonitor Backup Directory Growth
Section titled “Monitor Backup Directory Growth”Even after disable, verify no new files:
# Before operationls /var/lib/cassandra/data/my_keyspace/my_table-*/backups/ | wc -l# Count: 50
# Force flushnodetool flush my_keyspace
# After flush (should be same if disabled)ls /var/lib/cassandra/data/my_keyspace/my_table-*/backups/ | wc -l# Count: 50 (unchanged)Troubleshooting
Section titled “Troubleshooting”Status Still Shows "running"
Section titled “Status Still Shows "running"”# Retry disablenodetool disablebackup
# Check JMX connectivitynodetool info
# Verifynodetool statusbackupBackup Files Still Appearing
Section titled “Backup Files Still Appearing”If new backup files appear after disable:
# Verify disablednodetool statusbackup# Should be: not running
# Check cassandra.yaml (might override on restart)grep incremental_backups /etc/cassandra/cassandra.yaml
# If yaml says true, update itvim /etc/cassandra/cassandra.yaml# Set: incremental_backups: falseCannot Remove Backup Files
Section titled “Cannot Remove Backup Files”If deletion fails:
# Check file ownershipls -la /var/lib/cassandra/data/my_keyspace/*/backups/
# Check if files are openlsof +D /var/lib/cassandra/data/my_keyspace/my_table/backups/
# May need to run as cassandra usersudo -u cassandra rm -rf /var/lib/cassandra/data/*/*/backups/*Cluster-Wide Disable
Section titled “Cluster-Wide Disable”Disable backup across all nodes:
#!/bin/bash# Get list of node IPs from local nodetool statusnodes=$(nodetool status | grep "^UN" | awk '{print $2}')
echo "Disabling incremental backup cluster-wide"echo "==========================================="
for node in $nodes; do echo -n "$node: " ssh "$node" "nodetool disablebackup 2>/dev/null && echo 'disabled' || echo 'failed'"done
echo ""echo "Verification:"for node in $nodes; do echo -n "$node: " ssh "$node" "nodetool statusbackup"doneBest Practices
Section titled “Best Practices”Disable Backup Guidelines
- Document the reason - Note why backup was disabled
- Copy before cleanup - Always backup before deleting files
- Update cassandra.yaml - Make change persistent if intended
- Verify status - Confirm disabled with
statusbackup - Clean up disk - Remove old backup files to reclaim space
- Cluster consistency - Apply to all nodes if disabling cluster-wide
- Re-enable after maintenance - Don't forget to restore backup if temporary
Related Commands
Section titled “Related Commands”| Command | Relationship |
|---|---|
| enablebackup | Enable incremental backup |
| statusbackup | Check backup status |
| snapshot | Full point-in-time backup |
| listsnapshots | List existing snapshots |
| clearsnapshot | Remove snapshots |