Skip to content

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

nodetool refresh

Deprecated in Cassandra 4.0+

nodetool refresh is deprecated since Cassandra 4.0. Use nodetool import instead, which provides more options including the ability to import from external directories.

Loads newly placed SSTables into a running node without restart.


Terminal window
nodetool [connection_options] refresh <keyspace> <table>

See connection options for connection options.

nodetool refresh scans a table's data directory for new SSTable files and loads them into the running Cassandra process. This is useful for bulk loading data or restoring from backups without restarting the node.


ArgumentDescription
keyspaceThe keyspace containing the table
tableThe table to refresh

After copying SSTables from another source:

Terminal window
# 1. Copy SSTables to data directory
cp /backup/nb-*.db /var/lib/cassandra/data/my_keyspace/my_table-uuid/
# 2. Load them into Cassandra
nodetool refresh my_keyspace my_table
Terminal window
# 1. Copy snapshot files
cp /snapshots/backup_name/*.db /var/lib/cassandra/data/my_keyspace/my_table-uuid/
# 2. Refresh to load
nodetool refresh my_keyspace my_table

For loading SSTables generated on the same cluster topology:

Terminal window
# Simpler than sstableloader when topology matches
nodetool refresh my_keyspace my_table

Terminal window
nodetool refresh my_keyspace my_table
bulk_load.sh
#!/bin/bash
KEYSPACE="my_keyspace"
TABLE="my_table"
DATA_DIR="/var/lib/cassandra/data/$KEYSPACE"
TABLE_DIR=$(ls -d $DATA_DIR/${TABLE}-* 2>/dev/null | head -1)
# Copy SSTables
cp /source/sstables/*.db "$TABLE_DIR/"
cp /source/sstables/*.txt "$TABLE_DIR/"
# Load into Cassandra
nodetool refresh $KEYSPACE $TABLE
echo "Loaded SSTables into $KEYSPACE.$TABLE"

Version Match Required

SSTables must be compatible with the running Cassandra version:

  • Same or older SSTable format version
  • If older, consider running upgradesstables after refresh

SSTables must be placed in the correct data directory:

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

A complete SSTable includes multiple files:

nb-1-big-Data.db
nb-1-big-Index.db
nb-1-big-Filter.db
nb-1-big-Statistics.db
nb-1-big-Summary.db
nb-1-big-TOC.txt
nb-1-big-CompressionInfo.db # If compressed

All files for an SSTable must be present.


  1. Cassandra scans the table directory for new SSTables
  2. Validates SSTable format and compatibility
  3. Loads SSTable metadata into memory
  4. Makes data available for queries
  5. SSTables become part of normal compaction cycle

Aspectrefreshimport
LocationMust be in data directoryCan be from external directory
File handlingFiles stay in placeFiles can be moved or copied
Use caseQuick loadExternal bulk import

If SSTables are from a different cluster or schema version:

Terminal window
# May need to use sstableloader instead
sstableloader -d localhost /path/to/sstables/
ERROR: Missing component Data.db

Ensure all SSTable component files are present.

Terminal window
# Fix ownership
chown -R cassandra:cassandra /var/lib/cassandra/data/my_keyspace/my_table-*/
# Then refresh
nodetool refresh my_keyspace my_table

Verify the table UUID directory:

Terminal window
# Find correct directory
ls -la /var/lib/cassandra/data/my_keyspace/ | grep my_table

Terminal window
# Verify data is visible
nodetool tablestats my_keyspace.my_table
# Query the data
cqlsh -e "SELECT COUNT(*) FROM my_keyspace.my_table;"
Terminal window
tail -f /var/log/cassandra/system.log | grep -i refresh

Refresh Guidelines

  1. Validate SSTables first - Check compatibility before copying
  2. Use correct permissions - cassandra:cassandra ownership
  3. Copy all files - Include all SSTable components
  4. Monitor after refresh - Check for errors in logs
  5. Consider repair - Run repair after bulk load for consistency

For loading SSTables to a different cluster or when topology differs:

Terminal window
sstableloader -d node1,node2,node3 /path/to/sstables/

sstableloader is more flexible but slower than refresh.


CommandRelationship
importImport SSTables from external location
tablestatsVerify table after refresh
upgradesstablesUpgrade SSTable format if needed
snapshotCreate backups to restore later