Advanced Cloudbreak Configuration
Also available as:
PDF

Configure external Cloudbreak database

Perform these steps to configure Cloudbreak with an existing external database, other than the embedded PostgreSQL database instance that Cloudbreak uses by default.

Steps

  1. On your Cloudbreak host machine, set the following environment variables according to the settings of your external database:
    export DATABASE_HOST=my.database.host
    export DATABASE_PORT=5432
    export DATABASE_USERNAME=admin
    export DATABASE_PASSWORD=Admin123!
  2. On your external database, create three databases: cbdb, uaadb, periscopedb. You can create these databases using the createdb utility with the following commands:
    createdb -h $DATABASE_HOST -p $DATABASE_PORT -U $DATABASE_USERNAME cbdb
    createdb -h $DATABASE_HOST -p $DATABASE_PORT -U $DATABASE_USERNAME uaadb
    createdb -h $DATABASE_HOST -p $DATABASE_PORT -U $DATABASE_USERNAME periscopedb
    For more information related to the "createdb" command refer to the PostgreSQL documentation.
    Note
    Note

    Alternatively, you can log in to the management interface of your external database and execute "create database" commands directly. Refer to PostgreSQL documentation for more information.

  3. Set the following variables in your Cloudbreak Profile file. Modify the database parameters according to your external database.
    export DATABASE_HOST=my.database.host
    export DATABASE_PORT=5432
    export DATABASE_USERNAME=admin
    export DATABASE_PASSWORD=Admin123!
        
    export CB_DB_PORT_5432_TCP_ADDR=$DATABASE_HOST
    export CB_DB_PORT_5432_TCP_PORT=$DATABASE_PORT
    export CB_DB_ENV_USER=$DATABASE_USERNAME
    export CB_DB_ENV_PASS=$DATABASE_PASSWORD
    export CB_DB_ENV_DB=cbdb
        
    export PERISCOPE_DB_PORT_5432_TCP_ADDR=$DATABASE_HOST
    export PERISCOPE_DB_PORT_5432_TCP_PORT=$DATABASE_PORT
    export PERISCOPE_DB_ENV_USER=$DATABASE_USERNAME
    export PERISCOPE_DB_ENV_PASS=$DATABASE_PASSWORD
    export PERISCOPE_DB_ENV_DB=periscopedb
    export PERISCOPE_DB_ENV_SCHEMA=public
        
    export IDENTITY_DB_URL=$DATABASE_HOST:$DATABASE_PORT
    export IDENTITY_DB_USER=$DATABASE_USERNAME
    export IDENTITY_DB_PASS=$DATABASE_PASSWORD
    export IDENTITY_DB_NAME=uaadb
  4. Restart Cloudbreak application by using the cbd restart command.

After performing these steps, your external database will be used for Cloudbreak instead of the built-in database.

Postrequisites

If your external database uses SSL, you must also perform the steps described in Configure an SSL certificate for an external Cloudbreak database.

If you would like to migrate your existing data (such as blueprints, recipes, and so on) from the embedded database to the external one, then after completing these steps, you should also create a backup of your original database and then restore it in the external database.