Using External Databases

Local databases are created during mobile platform server installation:

Local databases can be changed to external ones to solve the following tasks:

When setting up external databases, PostgreSQL version must match with the PostgreSQL version in the product software package:

Storing Information in External Databases without the Use of Fault-Tolerant Cluster

To store information in PostgreSQL external databases without the use of fault-tolerant cluster:

  1. Open the .env file for edit, which is located on a mobile platform server.

  2. Set parameters in the postgres section:

POSTGRES_MAIN_HOST=main_db	
POSTGRES_MAIN_PORT=5432
POSTGRES_MAIN_NAME=hhive
POSTGRES_MAIN_USERNAME=hhive
POSTGRES_MAIN_PASSWORD=hhive
POSTGRES_CACHE_HOST=cache_db
POSTGRES_CACHE_PORT=5432
POSTGRES_CACHE_NAME=hhive_cache
POSTGRES_CACHE_USERNAME=hhive
POSTGRES_CACHE_PASSWORD=hhive
  1. Save changes in the file.

After executing the operation, external databases will be used instead of local ones to store information.

Storing Information in External Databases in Cluster

To store information in PostgreSQL, Redis, S3 storage external databases in the Kubernetes, Deckhouse or OKD/OCP cluster:

  1. Open the values.production.yaml file for edit, which is located in the fmp folder on a mobile platform server.

  2. Set the parameters:

externalPostgres:
    maindb:
        enabled: true
        host: <host>
        port: <port>
        database: "<external database name>"
        username: "<user name>"
        password: "<password>"
    cachedb:
        enabled: true
        host: <host>
        port: <port>
        database: "<external database name>"
        username: "<user name>"
        password: "<password>"
externalRedis:
    useInternal: false
    host: <host>
    port: <port>
    password: "<password>"
    sentinel:
        host: <host>
        enabled: false
        port: <port>
        sentinelPort: 26379
        masterSet: "<external database name>"
externalS3:
  userInternal: false
  host: <host>
  port: <port>
  access_key_id: "<access key identifier>"
  secret_key: "<secret key>"
  is_ssl: false
  1. Save changes in the file.

After executing the operations, external databases will be used instead of local ones to store information in a cluster.

See also:

Installing and Setting Up Foresight Mobile Platform | Adding Alternative Domains