High Availability (HA) and Continuous Integration (CI) with Nexus OSS

CI Server HA - 520

Author, Ilkka Turunen

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:

Load Balancing with Nexus OSS

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:

High Availability CI Server with Nexus OSS - Click to view full diagram

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/content/uploads/2014/11/Nexus-Pro-Deployment-Guidelines.pdf

The following two tabs change content below.
Ilkka Turunen is a Solutions Architect at Sonatype. He has worked with companies large and small as a infrastructure consultant and as a developer. Now he aims to show how the Nexus products can benefit teams large and small. He's based in London, UK and can best be found in a coffee shop near the silicon roundabout.
Authors

Related posts

One Comment;

  1. Ruslan Ustiugov said:

    Hi Ilkka Turunen,

    What about High Availability in the Nexus 3 OSS?
    Is there some difference?

*

Top