Local databases are created during mobile platform server installation:
maindb. It is used to store administrator console settings, API users accounts, data sources parameters, and other system information.
cachedb. It is used to store cache of data sources resources.
Local databases can be changed to external ones to solve the following tasks:
Use of Postgres Pro. PostgreSQL is used by default.
Accelerated handling of mobile platform server requests if the number of use is more than 10000. The number of users can be changed depending on the task.
Use of different statements for data backup and information protection. The StackGres operator is used by default for local databases.
When setting up external databases, PostgreSQL version must match with the PostgreSQL version in the product software package:
Without fault-tolerant cluster 22.04 - PostgreSQL 10.20.
Without fault-tolerant cluster 23.05 - PostgreSQL 10.23.
Without fault-tolerant cluster 23.12 - PostgreSQL 15.4.
With fault-tolerant cluster based on Kubernetes, Deckhouse or OKD/OCP 22.04, 23.05 - PostgreSQL 12.3.
With fault-tolerant cluster based on Kubernetes, Deckhouse or OKD/OCP 22.04, 23.12 - PostgreSQL 15.4.
To store information in PostgreSQL external databases without the use of fault-tolerant cluster:
Open the .env file for edit, which is located on a mobile platform server.
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
Save changes in the file.
After executing the operation, external databases will be used instead of local ones to store information.
To store information in PostgreSQL, Redis, S3 storage external databases in the Kubernetes, Deckhouse or OKD/OCP cluster:
Open the values.production.yaml file for edit, which is located in the fmp folder on a mobile platform server.
Set the parameters:
For PostgreSQL in the externalPostgres section:
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>"
For Redis in the externalRedis section:
externalRedis:
useInternal: false
host: <host>
port: <port>
password: "<password>"
sentinel:
host: <host>
enabled: false
port: <port>
sentinelPort: 26379
masterSet: "<external database name>"
For S3 storage in the externalS3 section:
externalS3:
userInternal: false
host: <host>
port: <port>
access_key_id: "<access key identifier>"
secret_key: "<secret key>"
is_ssl: false
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