Skip to content

AxonOps — AI-Native Control Plane for Open Source Data Platforms

nodetool listsnapshots

Displays a list of all snapshots on the node with their sizes.


Terminal window
nodetool [connection_options] listsnapshots [options]

See connection options for connection options.

nodetool listsnapshots shows all snapshots on the local node, including:

  • Snapshot tag name
  • Keyspace and table names
  • True data size
  • Disk space consumed

Essential for monitoring backup state and managing disk space.


OptionDescription
-e, --ephemeralInclude ephemeral snapshots
-k, --keyspace <keyspace>Filter by keyspace name
-n, --snapshot <name>Filter by snapshot name
-nt, --no-ttlExclude snapshots with TTL
-t, --table <table>Filter by table name

Snapshot Details:
Snapshot name Keyspace name Column family name True size Size on disk Creation time
backup_20240115 my_keyspace users 1.5 GB 1.5 GB 2024-01-15T10:30:00Z
backup_20240115 my_keyspace orders 2.3 GB 2.3 GB 2024-01-15T10:30:00Z
backup_20240108 my_keyspace users 1.2 GB 0 bytes 2024-01-08T10:30:00Z
backup_20240108 my_keyspace orders 2.1 GB 0 bytes 2024-01-08T10:30:00Z
pre_upgrade system_schema tables 45 MB 45 MB 2024-01-14T22:00:00Z
Total TrueDiskSpaceUsed: 7.15 GB

FieldDescription
Snapshot nameTag used when creating the snapshot
Keyspace nameKeyspace containing the table
Column family nameTable name
True sizeActual data size in the snapshot
Size on diskCurrent disk space consumed
Creation timeWhen the snapshot was created
True sizeSize on diskMeaning
1.5 GB1.5 GBOriginal SSTables still exist (hard links)
1.5 GB0 bytesOriginal SSTables compacted away (space freed)
1.5 GB500 MBPartially compacted

Size on Disk

"Size on disk" shows actual disk blocks consumed. When original SSTables are compacted, the hard links become the only reference, and size on disk increases.


Terminal window
nodetool listsnapshots
Terminal window
nodetool listsnapshots -e
Terminal window
nodetool listsnapshots -n
Terminal window
nodetool listsnapshots | grep backup_20240115
Terminal window
nodetool listsnapshots | tail -1
Terminal window
nodetool listsnapshots | grep -c "^[a-zA-Z]"

Check existing snapshots to avoid duplicates:

Terminal window
nodetool listsnapshots | grep my_new_tag

When disk usage is high:

Terminal window
nodetool listsnapshots
# Check Total TrueDiskSpaceUsed at the bottom

Verify snapshot was created:

Terminal window
nodetool snapshot -t my_backup my_keyspace
nodetool listsnapshots | grep my_backup

Identify snapshots to remove:

Terminal window
nodetool listsnapshots
# Find old snapshots by creation time

backup_20240115 my_keyspace users 1.5 GB 1.5 GB 2024-01-15T10:30:00Z
  • True size = Size on disk = Original SSTables still exist
  • Hard links share disk blocks with active SSTables
  • Minimal additional space used
backup_20240101 my_keyspace users 1.5 GB 1.5 GB 2024-01-01T10:30:00Z

After compaction runs:

  • Original SSTables removed
  • Snapshot files become sole reference
  • Now consuming full 1.5 GB
Snapshot Details:
Total TrueDiskSpaceUsed: 0 bytes

No snapshots exist on this node.


Terminal window
for node in node1 node2 node3; do
echo "=== $node ==="
ssh "$node" "nodetool listsnapshots | tail -3"
done
Terminal window
# Log snapshot sizes daily
echo "$(date),$(nodetool listsnapshots | tail -1 | awk '{print $2}')" >> /var/log/snapshot_sizes.csv
Terminal window
total=$(nodetool listsnapshots | tail -1 | awk '{print $2}' | sed 's/GB//')
if (( $(echo "$total > 100" | bc -l) )); then
echo "WARNING: Snapshot usage exceeds 100GB"
fi

Snapshots are stored in:

/var/lib/cassandra/data/<keyspace>/<table>-<uuid>/snapshots/<tag>/

To manually check sizes:

Terminal window
# All snapshots
du -sh /var/lib/cassandra/data/*/*/snapshots/*
# Specific snapshot
du -sh /var/lib/cassandra/data/*/*/snapshots/backup_20240115/

If no snapshots are shown but you expect them:

  1. Check if snapshots were taken on this node
  2. Verify snapshot directory exists:
    Terminal window
    ls /var/lib/cassandra/data/*/*/snapshots/

Size reporting depends on filesystem support for hard links:

  • Some filesystems may not accurately report shared blocks
  • Use du for precise measurements if needed

Old snapshots consuming significant space:

Terminal window
# Identify largest snapshots
nodetool listsnapshots | sort -k4 -h
# Clear old snapshots
nodetool clearsnapshot -t old_snapshot_tag

Snapshot Monitoring Guidelines

  1. Regular checks - Include in daily monitoring
  2. Set retention alerts - Alert when snapshots age
  3. Track total size - Monitor growth trends
  4. Clean up promptly - Remove snapshots after backup verification
  5. Use TTL snapshots - Auto-delete when possible (4.0+)
  6. Document naming - Use consistent, dated snapshot names

CommandRelationship
snapshotCreate snapshots
clearsnapshotRemove snapshots
tablestatsTable-level statistics