Skip to main content

Load Balancing (Legacy)

Note

High Availability Clustering is a legacy feature that only works on the Orient database.

All new deployments should use one of our new high availability or resilient deployment options described in Resiliency and High Availability.

Load balancing is required to achieve transparent redundancy in a High Availability Cluster. The following outlines considerations relating specifically to Nexus Repository.

Ports

Nexus Repository listens on port 8081 for HTTP by default. There is no default port for HTTPS. These ports are also configurable (seeChanging the HTTP Port).

Docker Repositories

The docker client does not allow a context as part of the path to a registry, as the namespace and image name are embedded in the URLs it uses. Nexus Repository allows custom ports to be exposed to create a listener on a root context. See SSL and Repository Connector Configuration for more details. Alternatively you may choose to use a URL rewriting scheme to achieve the same results without needing to configure custom ports (not covered here). Using URL rewriting allows you to sidestep this limitation, otherwise exposing and using the configured port(s) are required.

Sticky Sessions

The Nexus Repository UI uses a cookie named NXSESSIONID to maintain a users state. The load balancer should be configured to enforce sticky sessions for requests containing this cookie.

User UI state is unique to each node in the cluster. All UI requests for the same session should be directed to the same node.

Monitoring Node Health

Nexus Repository provides two endpoints you can use to check the status of your node. The Readable Health Check endpoint verifies that a node can handle read requests. The Writable Health Checkendpoint verifies that a node can handle read and write requests. Since a node that can handle read requests but not write requests may still be considered serviceable, it is left to the user to decide which status endpoint to use.

These endpoints can be used by a load balancer to determine if a node should be considered to handle requests. For both status endpoints, Success is represented as HTTP 200 OK. Failure is represented as HTTP 503 SERVICE UNAVAILABLE. The nexus.log file for the node should be inspected for further details.

The URLs for the Health Check endpoints are:

Name

URL

ReadableHealth Check

http://<hostname>:<port>/service/rest/v1/status

Writable Health Check

http://<hostname>:<port>/service/rest/v1/status/writable

SSL Termination

Nexus Repository can be configured to serve content using SSL (seeConfiguring to Serve Content via HTTPS). The recommended approach for HA-C is to use the load balancer for SSL termination as it alleviates the need to configure certificates on each node.