Skip to main content
Question

Specify custom S3 endpoint for backup

  • May 8, 2020
  • 8 replies
  • 20 views

vishakha_lall

I am trying to backup the Vertica cluster to a S3 like data store internal to my enterprise network. We have similar credentials (ACCESS KEY and SECRET KEY).
Here's how my .ini file looks like

[S3]
s3_backup_path = s3://vertica_backups
s3_backup_file_system_path = []:/vertica/backups
s3_concurrency_backup = 10
s3_concurrency_restore = 10

[Transmission]
hardLinkLocal = True

[Database]
dbName = production
dbUser = dbadmin
dbPromptForPassword = False

[Misc]
snapshotName = fullbak1
restorePointLimit = 3
objectRestoreMode = createOrReplace
passwordFile = pwdfile
enableFreeSpaceCheck = True

Where can I supply my specific endpoint? For instance, my S3 store is available on a.b.c.d:80. I have tried changing s3_backup_path = a.b.c.d:80://wms_vertica_backups but I get the error Error: Error in VBR config: Invalid s3_backup_path. Also, I have the ACCESS KEY and SECRET KEY in ~/.aws/credentials.

After going through more resources I have exported the following ENV variables VBR_BACKUP_STORAGE_ENDPOINT_URL, VBR_BACKUP_STORAGE_ACCESS_KEY_ID, VBR_BACKUP_STORAGE_SECRET_ACCESS_KEY. vbr init throws the error Error: Unable to locate credentials Init FAILED. , I'm guessing it is still trying to connect to the AWS S3 servers. (Now removed credentials from ~/.aws/credentials

I think it's worthy to add that I'm running Vertica Enterprise mode.

8 replies

LenoyJ
Forum|alt.badge.img+1
  • Participating Frequently
  • May 8, 2020

What version are you on? The VBR capability for compatible on-prem S3 environments was added in 9.3.1.


vishakha_lall
  • Author
  • Participating Frequently
  • May 11, 2020

@LenoyJ I'm using Vertica Enterprise mode 8.1.1, is there any work around for the version that I am using?


sahil_kumar
Forum|alt.badge.img
  • Participating Frequently
  • May 11, 2020

Workaround:

  • Make sure DEFAULT_REGION, ACCESS_KEY_ID and SECRET_ACCESS_KEY environment variables are set.
  • The DEFAULT_REGION does not make sense for S3 on prem, but you have to set it anyways else you'll get a "You must specify a region" error
  • Edit line 771 of /opt/vertica/bin/vbr.py (ie the s3_endpoint_url() function)
    (Line number may vary from version to version)

  • Instead of returning None, return your endpoint URL(i have put mine for reference), ie
    return 'http://172.16.61.248:443';

  • Proceed to use initialize your config and use vbr as usual.

If you get a "You must specify a region" error from other nodes, you might to add export DEFAULT_REGION="us-east-1" to ~/.bashrc of dbadmin


vishakha_lall
  • Author
  • Participating Frequently
  • May 11, 2020

@sahil_kumar Yep, that worked like a breeze, the line number for s3_endpoint_url was different for me but it was easy to figure out. Thanks a ton!


vishakha_lall
  • Author
  • Participating Frequently
  • May 11, 2020

This can now be ignored, resolved!


sahil_kumar
Forum|alt.badge.img
  • Participating Frequently
  • May 11, 2020

Thanks for the confirmation @vishakha , but will recommend to get upgrade to vertica 9.3.1 or higher as you might need some other workarounds for other different operations(other than vbr) while using on-prem S3 in vertica 8.1.1.


ttbestas
  • New Participant
  • February 1, 2021

@sahil_kumar i have 9.2.1 version, done everything per your instructions but still getting region error:
File "/opt/vertica/oss/python/lib/python2.7/site-packages/botocore-1.5.65-py2.7.egg/botocore/signers.py", line 229, in get_auth_instance
raise botocore.exceptions.NoRegionError()
NoRegionError: You must specify a region.

evi ~/.bashrc
export DEFAULT_REGION="us-east-1"
export ACCESS_KEY_ID=x
export SECRET_ACCESS_KEY=x
export REGION="us-east-1"
export VBR_BACKUP_STORAGE_ACCESS_KEY_ID=x
export VBR_BACKUP_STORAGE_SECRET_ACCESS_KEY=x
export AWS_REGION="us-east-1"

also i get AWSRegion=us-east-1 on all nodes if i check vs_configuration_parameters


SruthiA
Forum|alt.badge.img+1
  • Participating Frequently
  • February 1, 2021

@ttbestas Can you share me your ini file used for backup?