Interesting question from a client:
“How can I do HA with Nexus OSS? Our CI Server has hundreds of projects writing to our nexus instance at a fixed time (e.g. 9pm). We would like to ensure that the Nexus server can cope with this load. How do I ensure nexus stays performant?”
Nexus 2 OSS comes with a few ways to do High Availability and performance tuning. The read/write performance of Nexus is most dependent on the speed and size of the disk it is running on. If you want to make sure that Nexus will cope with the reads/writes, then make sure it is deployed on a server with a disk that has a high enough IOPS. Nexus is light in terms of RAM and CPU – a machine that is medium spec (2 CPU + 4GB RAM) will be able to cope with most loads. Adjust accordingly of course.
We also need our CI Server to be highly available. What are my options?
Nexus stores everything within it’s work directory, including databases, journals and all of the artifacts. This means that with Nexus OSS, you could do a Cold copy via a NFS, the whole thing fronted by a IP/DNS Switch. Should the master go down, you could just start up the cold slave and point the DNS to it. See the following diagram:
For just Read operations, normal load balancing is entirely possible. In this case you’d have a “Write” Nexus that would have the CI servers writing to, And “Read” servers that would then be proxy repositories of the writer. You can then load balance between the READ repositories:
Combining these two approaches would deliver HA in most cases. However, because of the complex proxy relationships retrieving artifacts on the read instances can take time depending on network latency etc. It is suited to moderate amounts of teams.
Now, outside of OSS, Nexus Pro supports Smart Proxying – essentially a write-log replication model. A Master nexus can publish every write to subscribing slaves. In this scenario if the master goes down, you can fall back instantly on a slave to the point it was synchronised. It also has a certificate trust chain to make sure the servers are subscribing to the correct copies. You can then connect all of these three pictures into a quite a redundant solution.
This white paper talks about the deployment guidelines for Nexus Pro: http://www.sonatype.org/nexus/
Latest posts by Ilkka Turunen (see all)
- The Latest Victim of Deserialization-Gate - November 23, 2015
- Nexus and SSL - November 4, 2015
- 3 Things Developers Can Learn from the Scandal at VW - October 28, 2015
- Automating Nexus Deployment: Cookbooks, Modules and Playbooks - August 18, 2015
- Using the REST API in Nexus 2.x - August 13, 2015