Using an external (remote) database๐
Note
This feature is available for all Eocortex licenses and requires no additional licensing.
In Eocortex version 4.6, it is possible to use an external (remote) database to store event information. This feature allows using the event database independently of archive drives. At the same time, the depth of event storage is still determined by the depth of the archive.
Requirements and recommendations๐
It is not recommended to connect the same database to multiple servers. Each server should use a separate database.
If all servers use the same data schema for Eocortex, it is permissible to use a single shared DBMS cluster for both servers within a single multiserver system and for several such systems. In this case, the face and license plates databases will be shared by all systems connected to this cluster. If different schemas are used for the servers, their event and module databases will be unique for each server.
All modules of video analytics that use databases must operate in local database mode.
In additional server settings, it is required to select at least one drive for writing the database, but the drive assignment will be ignored.
Using the database identifier (DbId) via the REST API is not supported.
Settings๐
PostgreSQL is installed automatically along with the components of Eocortex. Below are the instructions for switching to an external (remote) database.
The database connection parameters are specified in the ArchiveSystem.xml file in the PostgreSqlConfig section:
<PostgreSqlConfig>
<Ip>192.168.100.125</Ip>
<Port>5432</Port>
<User>postgres</User>
<Password>masterkey</Password>
<IsExternallyManaged>true</IsExternallyManaged>
<EventDatabaseName>mydatabase</EventDatabaseName>
<DefaultSchemaName>public</DefaultSchemaName>
</PostgreSqlConfig>
Description of parameters:
Ip: the address of the computer on which PostgreSQL is installed.
Port: the port used by PostgreSQL for connections.
User: the PostgreSQL username under which the connection is being made.
Password: PostgreSQL user password.
IsExternallyManaged: determining the mode of operation with a remote database.
EventDatabaseName: the name of the database used to store events.
DefaultSchemaName: the database schema in which tables, views, and procedures will be created. By default, the server uses the public schema. The parameter applies to all databases used by the server.
Configuring access rights๐
If the connection is made on behalf of a database user with limited rights, it is necessary to create a database in the EventDatabaseName parameter, grant this user full access to the schema specified in the DefaultSchemaName parameter, and enable the cube extension.
GRANT ALL ON SCHEMA public TO username;
CREATE EXTENSION IF NOT EXISTS cube;
If the user has the right to create databases, the server will create the database and the necessary schemas, tables, procedures, and views automatically.
Databases of analytics modules๐
The Face Recognition, License Plate Recognition, and Search for Objects modules use the database connection settings specified in the ArchiveSystem.xml file.
Default path for Windows:
C:\ProgramData\EocortexServerConfigs\ArchiveSystem.xml
Default path for Linux:
/opt/EocortexServer/EocortexServerConfigs/ArchiveSystem.xml
Note
The local database must be specified in the module settings.
In order for a user with limited rights to have access to the video analytics module database, the following databases must be created for these modules:
Modules |
Database name |
|---|---|
License Plate Recognition |
platesdblocal |
Face Recognition (Complete) |
frcomplete_local |
Face Recognition (Light) |
frlight_local |
It is also necessary to grant this user rights to the schema specified in DefaultSchemaName.
Note
For the Search for Objects module, the database specified in the EventDatabaseName parameter is used instead of the standard modb database.