Evicting remote buckets and cached data
This guide demonstrates three ways to evict remote bucket content from AIStore using the ais evict command.
Overview
You can:
- Evict an entire remote bucket (data + metadata).
- Evict only the data, retaining bucket metadata.
- Evict a subset of objects using a prefix, template, or list.
The template is usually an optional prefix, range (Bash expansion, e.g.,
{start..end}), and optional suffix.
1. Evict the Entire Remote Bucket (Remove Data and Metadata)
To completely remove a remote bucket from AIStore—including its metadata—run ais evict without --keep-md.
This operation removes all cached content and the bucket’s entry from AIStore’s bucket metadata (BMD).
Check eviction job status (it usually completes in a split second, so use --all to show finished jobs):
2. Evict Only Bucket Data (Preserve Metadata)
To remove only the in-cluster objects while retaining the bucket metadata, use --keep-md (or -k):
This is useful for reclaiming space without losing bucket properties.
Confirm the bucket is still in-cluster:
Check eviction job status (use -all to show running and already finished jobs):
3. Evict a Specific Prefix, Template, or List
You can evict subsets of objects by specifying:
- A prefix in the object path
- A
--templatepattern (e.g., brace expansions) - A
--listof object names
Example: Evict by Prefix
Assume we’ve prefetched objects under the copy prefix:
Verify data was cached:
Notice 200 “cached” (ie., in-cluster) objects. Now evict just that prefix:
Or alternatively, use an explicit prefix:
You can also use brace-expansion syntax, e.g.
ais evict "s3://abc/shard-{0000..9999}.tar.lz4; see--helpfor details.
Check progress and notice that each target reports eviction statistics—object counts and their sizes.
This is because prefix-, template-, or list-based eviction requires AIStore to visit each matching object individually.
Example output:
In this particular case, 3-node cluster reported
(69+61+70) = 200evictions, consistent withais bucket summaryabove.
Summary
Use ais show job --all to monitor and verify jobs.