nodetool disablebackup¶
Disables incremental backup on the node.
Synopsis¶
nodetool [connection_options] disablebackup
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 SSTables upon memtable flush, 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: false
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¶
Basic Usage¶
nodetool disablebackup
Verify Disabled¶
nodetool disablebackup
nodetool statusbackup
# Expected output: not running
When to Use¶
Disk Space Management¶
When backup files consume too much space:
# Check current backup sizes
du -sh /var/lib/cassandra/data/*/*/backups/
# Total: 150GB
# Stop new backups
nodetool disablebackup
# Copy existing backups to external storage
rsync -av /var/lib/cassandra/data/*/*/backups/ /backup/server/
# Clean up local backups
find /var/lib/cassandra/data -path "*/backups/*" -type f -delete
# Verify cleanup
du -sh /var/lib/cassandra/data/*/*/backups/
Temporary Maintenance Disable¶
During maintenance operations:
# Disable during heavy operations
nodetool disablebackup
# Perform maintenance (repair, compaction, etc.)
nodetool repair -pr my_keyspace
# Re-enable after maintenance
nodetool enablebackup
# Verify
nodetool statusbackup
Switching Backup Strategy¶
When migrating to a different backup solution:
# Disable incremental backup
nodetool disablebackup
# Clean up existing backup files
find /var/lib/cassandra/data -path "*/backups/*" -delete
# (Configure new backup solution)
I/O Reduction¶
During I/O-intensive operations:
# Disable to reduce I/O overhead
nodetool disablebackup
# Perform I/O-intensive operation
nodetool upgradesstables
# Re-enable
nodetool enablebackup
Before Node Decommission¶
Remove unnecessary backup overhead before decommission:
# Disable backups (node is leaving)
nodetool disablebackup
# Clean up backup files
find /var/lib/cassandra/data -path "*/backups/*" -delete
# Proceed with decommission
nodetool decommission
Impact Assessment¶
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¶
- Existing backup files remain (must clean manually)
- Snapshots are unaffected
- Compaction behavior unchanged
- Normal data operations continue
Cleanup After Disable¶
Disabling backup does not remove existing files:
Check Backup Size¶
# Per-keyspace backup sizes
du -sh /var/lib/cassandra/data/*/*/backups/
# Total backup size
find /var/lib/cassandra/data -path "*/backups/*" -type f -exec du -ch {} + | tail -1
Copy Before Cleanup¶
# Back up to external storage first
rsync -av /var/lib/cassandra/data/*/*/backups/ /backup/final_incremental/
Remove Backup Files¶
# Remove all backup files (careful!)
find /var/lib/cassandra/data -path "*/backups/*" -type f -delete
# Or remove per-keyspace
rm -rf /var/lib/cassandra/data/my_keyspace/*/backups/*
# Verify removal
find /var/lib/cassandra/data -path "*/backups/*" -type f | wc -l
# Should be 0
Workflow: Complete Backup Disable and Cleanup¶
#!/bin/bash
# disable_and_cleanup_backup.sh
echo "=== Disable Incremental Backup ==="
echo ""
# 1. Check current state
echo "1. Current status: $(nodetool statusbackup)"
# 2. Check current backup size
echo "2. Current backup size:"
find /var/lib/cassandra/data -path "*/backups/*" -type f -exec du -ch {} + 2>/dev/null | tail -1
# 3. Disable backup
echo "3. Disabling incremental backup..."
nodetool disablebackup
# 4. Verify disabled
echo "4. New status: $(nodetool statusbackup)"
# 5. Optional: Clean up existing backups
read -p "5. Remove existing backup files? (y/n): " cleanup
if [ "$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¶
Hard Links Explained¶
When backup is enabled, SSTables have hard links in the backups directory:
SSTable: /data/keyspace/table/nb-1-big-Data.db
Backup: /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¶
To reclaim space after disabling:
# Check space used by backups
du -sh /var/lib/cassandra/data/*/*/backups/
# Remove to reclaim
find /var/lib/cassandra/data -path "*/backups/*" -delete
# Verify space recovered
df -h /var/lib/cassandra
Runtime vs Persistent Configuration¶
Runtime (Temporary)¶
nodetool disablebackup
# Does not persist across restart
Persistent (Permanent)¶
Edit cassandra.yaml:
incremental_backups: false
Then either restart or use nodetool:
# For immediate effect without restart
nodetool disablebackup
Comparison¶
| Method | Effect | Persistence |
|---|---|---|
nodetool disablebackup |
Immediate | Until restart |
cassandra.yaml: false |
After restart | Permanent |
| Both | Immediate + permanent | Best practice |
Monitoring¶
Verify Status¶
nodetool statusbackup
# Expected: not running
Monitor Backup Directory Growth¶
Even after disable, verify no new files:
# Before operation
ls /var/lib/cassandra/data/my_keyspace/my_table-*/backups/ | wc -l
# Count: 50
# Force flush
nodetool 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¶
Status Still Shows "running"¶
# Retry disable
nodetool disablebackup
# Check JMX connectivity
nodetool info
# Verify
nodetool statusbackup
Backup Files Still Appearing¶
If new backup files appear after disable:
# Verify disabled
nodetool statusbackup
# Should be: not running
# Check cassandra.yaml (might override on restart)
grep incremental_backups /etc/cassandra/cassandra.yaml
# If yaml says true, update it
vim /etc/cassandra/cassandra.yaml
# Set: incremental_backups: false
Cannot Remove Backup Files¶
If deletion fails:
# Check file ownership
ls -la /var/lib/cassandra/data/my_keyspace/*/backups/
# Check if files are open
lsof +D /var/lib/cassandra/data/my_keyspace/my_table/backups/
# May need to run as cassandra user
sudo -u cassandra rm -rf /var/lib/cassandra/data/*/*/backups/*
Cluster-Wide Disable¶
Disable backup across all nodes:
#!/bin/bash
# disable_backup_cluster.sh# Get list of node IPs from local nodetool status
nodes=$(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"
done
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¶
| Command | Relationship |
|---|---|
| enablebackup | Enable incremental backup |
| statusbackup | Check backup status |
| snapshot | Full point-in-time backup |
| listsnapshots | List existing snapshots |
| clearsnapshot | Remove snapshots |