PostgreSQL Database(4.0)

This section describes the preparations necessary to do when doing a customized  production installation, using PostgreSQL as platform database instead of the the default Derby database.

Note!

This section is optional and can be omitted if you are doing the default installation with Derby database.

PostgreSQL Database Instead of the Default Derby Database

Usage Engine supports PostgreSQL as platform database. If you choose to use PostgreSQL as your platform database, then you must install your database instance prior to deployment.

Install PostgreSQL Database

For the PostgreSQL helm installation, see https://artifacthub.io/packages/helm/bitnami/postgresql.

In order to use PostgreSQL, admin user and password must be defined.

Configure Usage Engine to Use PostgreSQL

The following steps assume PostgreSQL database has already installed and the pod is running.

  1. In the usage-engine-private-edition Helm install command, set the properties below:

    [Helm install command]... \
    --set platform.db.type=postgresql \
    --set postgres.adminUsername=postgres \
    --set postgres.adminPassword=<admin password> \
    --set postgres.host=<database host> \
    ...

    postgres.host is commonly set to the postgres pod service name.

  2. [Optional] In case of detailed customization is needed, you can download the usage-engine-private-edition Helm chart and modify values.yaml file, then Helm install using the modified helm chart.

    values.yaml
    # usage-engine-private-edition / values.yaml:
    
    platform:
      db:
        type: postgresql
        jdbcUser: mzadmin
        jdbcPassword: mz
    
    postgres:
      adminPassword: <admin password>       #postgres superuser password
      adminUsername: <admin username>       #postgres superuser name
      mzownerPassword: <mzowner password>   #Password to owner of all tables in postgres
      db: <name of database>                #postgres DB name
      port: 5432                            #postgres DB connection port
      host: <database host>                 #postgres DB hostname

    Note!

    The passwords In the values.yaml file: jdbcPassword, adminPassword and mzownerPassword need to be defined in clear text (and not encoded using base64) if they are going to be used. Consider using Bootstrapping System Certificates and Secrets - Private Cloud(4.0) instead

  3. During the platform pod initialization, the necessary database tables will be automatically created.