CloudFormation - Repository Manager

The following describes the process for deploying Nexus Repository Manager on Amazon Web Services using CloudFormation templates.

Requirements

  • An Amazon Web Services account
  • You have subscribed to the CentOS 7 image in the AWS Marketplace

Optional

  • A Nexus Repository Manager license file

    Note: a Nexus Repository Manager Pro license is required for HA-C (multi-instance).

  • An S3 Bucket to upload the Nexus Repository Manager license to

  • An AWS key pair if you wish to have SSH access to the EC2 instances. For instructions on creating your key pair please refer to the AWS Key Pair documentation. Please note that key pairs are per region.

Subscribe to the CentOS 7 Image

If you have not already subscribed to the CentOS 7 image, do the following:

Navigate your browser to https://aws.amazon.com/marketplace/pp/B00O7WM7QW and sign in to your AWS account

Click the Continue to Subscribe button

To create the subscription, review the pricing information and accept the terms.

Your subscription request is processing...

Single Instance

This section outlines the steps to provision a single instance of Nexus Repository Manager.

Select a region for deployment

The minimal template provides the ability to set the license parameters, as well as a key pair to access the EC2 instances. The detailed template allows you to additionally customize items like the network details and EC2 instance type, as well as the Nexus Repository Manager version and Java version.

Region

Detailed Template

Minimal Template
US East (N. Virginia)
US East (Ohio)
US West (Oregon)
EU (Ireland)
EU (Frankfurt)
Asia Pacific (Sydney)
Canada (Montreal)

Select template

On the Select Template page, accept the defaults and click the Next button.

Specify Details

On the Specify Details page, fill in the name of your stack (Stack name), the name of the Key Pair in the selected deployment region (Key pair). Optionally provide the name of the S3 Bucket that contains your Nexus Repository Manager license file (License S3 bucket) and the path to your Nexus Repository Manager license file in your S3 Bucket  (License S3 path). Then, click the Next button.

  • Key pairs are maintained over on the EC2 dashboard under "Key Pairs" in the left menu
  • If you haven't already loaded a Nexus Repository Manager Pro license up to S3 you can either create a new bucket in S3 or use an existing one and upload your license to either of those places
       

Options

If desired, fill out optional values on the Options page.

Review

On the Review page, make certain to check I acknowledge that AWS CloudFormation might create IAM resources with custom names and accept the other defaults. Then, click the Create button.

Stack Creation

Upon clicking the Create button on the Review page, you will be taken to the Stack page.

Stack Complete

After several  minutes, stack creation will complete.

Website URL

To find the resulting Nexus Repository Manager website URL, select the stack name (usually at the bottom) and open the Outputs tab. Then, click the WebsiteURL link.

Login to Nexus Repository Manager

The WebsiteURL link will take you to the Nexus Repository Manager welcome page. Click the Sign In button at the top-right to login. The default username and password are admin/admin123. See the Post Install Checklist for further info.

NOTE: The allocation of AWS resources takes a while and there will be a delay in Nexus Repository Manager spinning up. The CloudWatch log group generated for the stack will provide feedback as to the progress, generally if there are no logs AWS is still doing its allocation.


General Administration

SSH access to the Nexus Repository Instance

To SSH into the AWS Repository Instance, you need to have specified your AWS Key Pair during creation. The host name to connect to is available in the 'Outputs' section of the stack, you just need to remove the scheme (http) and port (8081). The username to use is "centos".

ssh -i <path to your key pair pem file> centos@ec2-54-68-224-196.us-west-2.compute.amazonaws.com

Managing the Repository Server service

The Nexus Repository server is controlled by the service name "nexus-repository-manager.service".  Once you SSH in to the instance as "centos", you can manage the service with:

To stop the service:                 sudo systemctl stop nexus-repository-manager.service

To start the service:                 sudo systemctl start nexus-repository-manager.service


High Availability (Multi-instance)

This section outlines the steps to provision a Nexus Repository Manager in a High Availability Cluster (known as HA-C) which uses Amazon S3 for blob store support. Please see the High Availability section of the help for more information on what HA-C is and how it is used.

Note: the screenshots for the HA-C setup almost exactly mirror those of the single instance setup above. Therefore these screenshots are not duplicated, and any differences are noted.

Select a region for deployment

Region

Detailed Template

Minimal Template
US East (N. Virginia)
US East (Ohio)
US West (Oregon)
EU (Ireland)
EU (Frankfurt)
Asia Pacific (Sydney)

Select template

On the Select Template page, accept the defaults and click the Next button.

Specify Details

On the Specify Details page, fill in the name of your stack (Stack name), and optionally the name of the Key Pair in the selected deployment region (Key pair). Additionally provide the name of the S3 Bucket that contains your Nexus Repository Manager Professional license file (License S3 bucket) and the path to your Nexus Repository Manager Professional license file in your S3 Bucket (License S3 path). Then, click the Next button.

  • Key pairs are maintained over on the EC2 dashboard under "Key Pairs" in the left menu
  • If you haven't already loaded a Nexus Repository Manager Pro license up to S3 you can either create a new bucket in S3 or use an existing one and upload your license to either of those places
      

HA-C specific configuration

If you are using the detailed template, you can choose an additional HA-C specific parameter on this page. This is how many redudant nodes in your HA-C setup you want. The minimum is 2. In order to avoid stack creation timeouts it is recommended to leave this value at its default for the initial stack creation, and then later follow the instructions to increase the number of nodes.

Options

If desired, fill out optional values on the Options page.

Review

On the Review page, make certain to check I acknowledge that AWS CloudFormation might create IAM resources with custom names and accept the other defaults. Then, click the Create button.

Stack Creation

Upon clicking the Create button on the Review page, you will be taken to the Stack page.

Stack Complete

After some time, stack creation will complete. During this time CloudFormation is spinning up three Nexus Repository Manager instances and fronting them with a load balancer. This can take up to 15 minutes.

Website URL

To find the resulting Nexus Repository Manager website URL, select the stack name (usually at the bottom) and open the Outputs tab. Then, click the WebsiteURL link. This is the link to the fronting elastic load balancer.

Login to Nexus Repository Manager

The WebsiteURL link will take you to the Nexus Repository Manager welcome page. Click the Sign In button at the top-right to login. The default username and password are admin/admin123. See the Post Install Checklist for further info.

NOTE: The allocation of AWS resources takes a while and there will be a delay in Nexus Repository Manager spinning up. The CloudWatch log group generated for the stack will provide feedback as to the progress, generally if there are no logs AWS is still doing its allocation.

View the node configuration

In the admin screen select 'System' and 'Nodes'. This will show you the participating nodes in the cluster.

Create an S3 blob store and repository

In the admin screen select 'Repository' and 'Blob Stores'. Click 'Create blob store' and for the 'Type' choose 'S3'. Enter a name for the blob store and the S3 bucket. The rest of the information is optional. If you do not override the authentication information then the authentication details are taken from the EC2 instance. The CloudFormation template is setup with permissions to allow NXRM to create S3 buckets.

Once the S3 blob store is created. Navigate to 'Repositories' and create a new repository and use the newly created S3 blob store as storage.

Increase the number of nodes

Access the AWS EC2 Dashboard (under 'Services' in the top left). On the left menu scroll down and access "Auto Scaling Groups". Here you will see two groups for your stack. One contains the name "InitialAutoScalingGroup" and the other just "AutoScalingGroup". The initial auto scaling group exists just to spin up the first initial NXRM node, and then the others are spun up to join it.

Click on the "AutoScalingGroup", click "Edit" in the panel that appears on the bottom, and increment the "Desired Capacity" to 3 and click "Save".


Now in the EC2 Dashboard select "Instances" and you should be able to observe the new instances spinning up. After they are spun up and the status checks pass you can head back to the Nexus Repository Manager admin dashboard, click 'System' and 'Nodes' in the menu and observe the new nodes as part of the cluster.

As an exercise you can also try to manually terminate one of the instances and observe Amazon automatically create a new one to replace it.