_Initializing an External Database - blackducksoftware/hub GitHub Wiki
This page has been deprecated. Please see the official Kubernetes Black Duck Installation Guide here.
Introduction
Before an external database can be used by Black Duck, it must be initialized. The recommended procedure can be found under "Configuring an external PostgreSQL instance" in the Black Duck Compose installation documentation, which can be found here.
The text below provides an introductory example of how to configure Black Duck to use an external Amazon RDS "Aurora DB". The same general approach could be followed for any external Postgres.
Create the DB instance
The external PostgreSQL instance needs to be initialized by creating users, databases, etc., and connection information must be provided to the authentication, jobrunner, scan, and webapp and containers.
- Login to AWS and under Services find and select RDS
- Select the 'Launch DB Instance' button
- Select 'Amazon Aurora' and near the bottom of this page select 'PostgreSQL-compatible' radio buttton
- On the Specify DB details page select the Class (or Size) of the instance (db.r3.2xlarge (8vcpu | 61Gi Ram)) is recommended as a minimum RDS Instance size
- Give the RDS a name (DB Instance Identifier)
- Under Master Username enter 'blackduck' - this is IMPORTANT!
- Specify a password - remember this password as you'll need this later to connect to the DB - Click Next
- Configure Advanced Settings: VPC and Subnet group: Do what's appropriate for your Organization
- Public Accessibility = YES
- Availability Zone: Choose what you prefer or your Organization uses
- DB Cluster identifier - Let Amazon create this for you
- Database Name = blackduck (or whatever you'd like)
- Disable Encryption
- Everything else on this page is Optional/up to you
Connect to the Aurora DB Instance
- We recommend connecting to your Aurora RDS Instance using pgAdmin4
- Launch pgAdmin and select 'Add New Server' from the main pgAdmin screen
- Give the connection a name and move to the Connection Tab. Under Hostname/address enter in the Amazon Aurora RDS 'Endpoint'. This 'endpoint' for your RDS is found under the 'Connect' section of the Instance details (from AWS open RDS >> Click/Select the Aurora RDS name, scroll down to 'Connect'). Endpoint name Example: hub47-aurora-jfs.XXXXXXXX.us-east-2.rds.amazonaws.com
- Save the Configuration and double-click the name and connect to the DB
- get and extract hub version X.X.X orchestration files from https://github.com/blackducksoftware/hub cd to the openshift directory
Populate the instance with data
- On YUM based systems installing psql client is done like so: yum install -y postgresql
- Run the 'external-postgres-init.pgsql' against your Aurora RDS instance
- E.g.
psql -U blackduck -h hub47-aurora-jfs.XXXXXXXX.us-east-2.rds.amazonaws.com -p 5432 -f ./external-postgres-init.pgsql blackduck_hub_470
- If you're migrating to the external DB, then use
pg_dump
to dump your bds_hub database into the external aurora instance. This could take a while. - You'll see the sql execute in the terminal so you can verify the file was executed
- From the pdAdmin tool open the blackduck database, expand Login/Group Roles, right click on the blackduck_user and select 'Properties' >> Select the 'Definition' tab and enter a PASSWORD for blackduck_user
- Do the exact same steps ^^^ for user blackduck_reporter ^^^