Can I pre-cache artifacts in Nexus proxy storage using rsync while Nexus is running?

You may wonder if manually copying or rsyncing artifacts to Nexus proxy repository storage while Nexus is running will help improve performance serving these artifacts. The short answer is:

No.

This isn't a good idea.

By doing this you will bypass the internal file locking in Nexus. This means that it is possible a request coming into the server will receive a partial file.

Also, there are directories at sonatype-work/nexus/storage/<repository>/.nexus and sonatype-work/nexus/storage/<repository>/.meta which store meta information about files in storage and the repository itself. This meta information is not the same on the proxy side as it is on the remote, so you could effectively put the proxy repository in an inconsistent state by using rsync. Also, if one of these files is in a partially written state when Nexus attempts to read it it could result in a download failure of the corresponding artifacts.

Search indexes would also not be updated in real time, unlike when an artifact was cached by nexus itself.

I would recommend instead using Nexus Professional's Smart Proxy with preemptive fetch enabled. If this is not working let us know and we will help diagnose the problem.

Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk