Configure ADCM to use an external database

ADCM supports operations with external databases. In particular, PostgreSQL databases are supported. If no external database is specified, the built-in SQlite database is used by default.

IMPRORTANT
PostgreSQL database is recommended for use in the product environment. SQLite database is intended for experimental purposes.

The prerequisites to use the external PostgreSQL database are:

  • The user, the database, and the user password must be created (DATABASE_USERNAME, DATABASE_NAME, DATABASE_USER_PASSWORD in the example below).

  • The user must be the owner of the external PostgreSQL database.

CREATE USER <DATABASE_USERNAME> with encrypted password '<DATABASE_USER_PASSWORD>';
CREATE DATABASE <DATABASE_NAME> OWNER <DATABASE_USERNAME>;

To run ADCM using PostgreSQL as a database, use the following command:

$ sudo docker run -d --restart=always -p 8000:8000 -v /opt/adcm:/adcm/data
  -e DB_HOST="<DATABASE_HOSTNAME_OR_IP_ADDRESS>" -e DB_PORT="<DATABASE_TCP_PORT>"
  -e DB_USER="<DATABASE_USERNAME>" -e DB_NAME="<DATABASE_NAME>"
  -e DB_PASS="<DATABASE_USER_PASSWORD>" --name adcm hub.arenadata.io/adcm/adcm:<version>

where <version> is a desired ADCM image version in one of the following formats:

  • <major>.<minor>.<patch> — if you need a specific ADCM patch. For example, 2.0.0.

  • <major>.<minor> — if you need the last patch within the selected ADCM version. For example, 2.0.

Note that before ADCM 2.0.0, the following format was used for versioning: YYYY.MM.DD.HH.

Use -v /opt/adcm:/adcm/data:Z for SELinux.

Found a mistake? Seleсt text and press Ctrl+Enter to report it