Skip to main content

Using Replicated Blob Stores

Nexus Repository provides a mechanism to override specific blob store attributes using environment variables used during the Nexus Repository startup. Use this mechanism to override the blob store bucket name attribute to point to a replica.

NEXUS_BLOB_STORE_OVERRIDE='{"blob-store-name": {"s3": {"bucket": "bucket-name"}}}'

The NEXUS_BLOB_STORE_OVERRIDE environment variable contains a JSON object with the properties to remap your blob store location.

The environment variable only updates the blob store configuration in the Nexus Repository database and does not modify the contents of the blob store. The blob store override environment variable does not copy contents between blob stores. Replicating blob stores is outside the scope of this feature.

Note

Blob store overrides are persistent. During startup, the override updates the blob_store_configuration.attributes values stored in the Nexus Repository database. Removing the NEXUS_BLOB_STORE_OVERRIDE environment variable does not restore the previous configuration. To revert a change, apply another override with the original values or update the blob store configuration using the UI or REST API.

You may override multiple blob stores in a single environment variable:

NEXUS_BLOB_STORE_OVERRIDE='{"blob-store-1": {"s3": {...}}, "blob-store-2": {"s3": {...}}, "blob-store-3": {"s3": {...}}}'

You may also override multiple attributes for an individual blob store:

NEXUS_BLOB_STORE_OVERRIDE='{"nxrm-blob-store": {"s3": {"bucket": "nxrm-bucket-stage", "region": "us-east-2"}}}'

The attributes available for override are defined for the blob store configuration in the Nexus Repository database. For a complete reference of blob store configuration attributes, see the REST API documentation. The same attribute names are used for NEXUS_BLOB_STORE_OVERRIDE.

The most common attributes for each environment are as follows:

  • AWS S3
    NEXUS_BLOB_STORE_OVERRIDE='{"blob-store-name": {"s3": {"bucket": "bucket-name"}}}'

    Example with additional attributes:

    {
      "my-s3-blobstore": {
        "s3": {
          "accessKeyId": "AKIAIOSFODNN7EXAMPLE",
          "secretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
          "region": "us-east-1",
          "bucket": "my-bucket",
          "prefix": "nexus-data"
        }
      }
    }

    Common Attributes

    • bucket

    • region

    • prefix

    • accessKeyId

    • assumeRole

    • sessionToken

    • secretAccessKey

    • endpoint

    • signertype

    • forcepathstyle

    • max_connection_pool_size

    • encryption_type

    • encryption_key

    • preSignedUrlEnabled

    • failover-buckets

  • Azure
    NEXUS_BLOB_STORE_OVERRIDE='{"azure-blob-name": {"azure cloud storage": {"containerName": "container2"}}}'

    Common Attributes

    • containerName

    • accountName

    • accountKey

  • Google Cloud Storage (GCS)
    NEXUS_BLOB_STORE_OVERRIDE='{"gcp-blob": {"google cloud storage": {"prefix": "/my-prefix", "region": "us-central1", "bucketName": "bucket-nxrm"}}}'

    Common Attributes

    • bucketName

    • region

    • prefix

    • project

    • credentialFilePath

  • File
    NEXUS_BLOB_STORE_OVERRIDE='{"file-blob-name": {"file": {"path": "backup-path"}}}'

    Common Attributes

    • path

  • Group Blob Store

    You can also override the configuration of a group blob store. This is useful when reconfiguring blob store group membership during disaster recovery or failover.

    NEXUS_BLOB_STORE_OVERRIDE='{"my-group": {"group": {"members": ["blob-store-1", "blob-store-2"], "fillPolicy": "writeToFirst"}}}'

    Common Attributes

    • members - JSON array of member blob store names. The specified array replaces the existing member list. it is not merged.

    • fillPolicy - Specifies how writes are distributed across member blob stores. Supported values are:

      • writeToFirst

      • roundRobin