Purge old indexes from Sonatype Nexus

7.3k views Asked by At

We're using Sonatype's Nexus 1.9.2.2 for proxying maven repositories. Our problem is that the indexes are eating so much disk space. All our repositories are taking about 25GB space, and growing.

For example, this directory has ~4GB of index files like this:

sonatype-work/nexus/storage/mvnsearch/.index/nexus-maven-repository-index.825.gz
sonatype-work/nexus/storage/mvnsearch/.index/nexus-maven-repository-index.826.gz
sonatype-work/nexus/storage/mvnsearch/.index/nexus-maven-repository-index.827.gz
sonatype-work/nexus/storage/mvnsearch/.index/nexus-maven-repository-index.828.gz
...

Is there any clean way of purging those files? For example using a scheduled task?

Thanks in advance!

2

There are 2 answers

0
Michael On

We run the "optimize repository index" weekly and also run the "empty trash" task hourly.

I can tell you that storage isn't an issue for us for indexes. We have a ton of files in those .index directories, but they're all under 1K in size...even for our central proxy repo. Our total comes in ~1GB.

However, our repo is quite large. We've got a very large number of artifacts though. We're currently at almost 300GB in repository disk space.

1
Vitali Bichov On

Stumbled on the same issue, even tried to talk with Sonatype.

They told me to just delete the files and rebuild the indices.