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
bucketregionprefixaccessKeyIdassumeRolesessionTokensecretAccessKeyendpointsignertypeforcepathstylemax_connection_pool_sizeencryption_typeencryption_keypreSignedUrlEnabledfailover-buckets
Azure
NEXUS_BLOB_STORE_OVERRIDE='{"azure-blob-name": {"azure cloud storage": {"containerName": "container2"}}}'Common Attributes
containerNameaccountNameaccountKey
Google Cloud Storage (GCS)
NEXUS_BLOB_STORE_OVERRIDE='{"gcp-blob": {"google cloud storage": {"prefix": "/my-prefix", "region": "us-central1", "bucketName": "bucket-nxrm"}}}'Common Attributes
bucketNameregionprefixprojectcredentialFilePath
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:writeToFirstroundRobin