Embedded PostgreSQL¶
The default MetaMiner Database (MMDB) is a PostgreSQL 16 instance that the installer places on the MetaMiner Server machine and MetaMiner manages for you.
How it works¶
| Item | Value |
|---|---|
| PostgreSQL binaries | server\pgsql-win-16.3.2\ |
| Data folder | server\data\mmdb\ |
| PostgreSQL logs | server\data\mmdb\logs\postgresql-<weekday>.log |
| Port | 49614 (config key postgres_port) |
| Database / owner | metaminer / mmuser |
| Windows service | InfolytikPostgres (display name "Infolytik Postgres DB") |
The database runs as the Windows service InfolytikPostgres. The MetaMiner Server (MMS) starts it when needed and waits until it accepts connections. MMS never stops it, so it keeps running when you stop MetaMiner.
On every start MMS re-applies MetaMiner's postgresql.conf and pg_hba.conf settings and reloads the database if they changed.
Older installations
Installations upgraded from earlier releases may run the database as a child process started by MMS ("pg_ctl" mode). MMS migrates such a database to the InfolytikPostgres service automatically at server start. If the migration fails three times, it keeps using pg_ctl until you click Promote now. Installations whose database is still on an older PostgreSQL major version keep using the matching older binaries.
Manage the embedded database¶
Open Configure MMDB. The Embedded database panel shows a status line, for example "Database: running as service InfolytikPostgres", and the buttons that apply to your installation.
| Button | When shown | What it does |
|---|---|---|
| Restart Database | Service mode | Stops and starts InfolytikPostgres, applying settings that need a restart. All MetaMiner connections drop; MMS reconnects. |
| Start Database / Stop Database | pg_ctl mode | Starts or stops the database. Only while the MetaMiner services are stopped. |
| Create embedded database | No database exists yet | Initializes the data folder, configures and registers the service, starts it and creates the roles. Only while the MetaMiner services are stopped. |
| Promote now | Migration to the service has stopped retrying | Retries the migration to the Windows service now. Only while the MetaMiner services are stopped. |
Image of the Configure MMDB dialog, Embedded database panel, showing Database: running as service InfolytikPostgres and the Restart Database button
../../images/admin/embedded-database-panel.png
Status messages
| Message | Meaning |
|---|---|
| Database: running as service ... | Healthy, service mode |
| Database: running / stopped | pg_ctl mode state |
| Database: started (managed by the running MetaMiner Server) | MMS owns the database right now |
| Database: not initialized - press Create embedded database | No data folder yet |
| Database: starting up (rejecting connections, retry shortly) | PostgreSQL is still starting |
| Database: in use by the Flow Scheduler Service (stop MetaMinerFSS first) | Stop the FSS service before this action |
| Database: status check failed - see admin.log | Check admin.log |
Change the database password¶
At each start MMS sets the passwords of mmuser and, if you entered one in Superuser password:, of the postgres superuser to the values stored in the MetaMiner configuration.
TODO: write the supported password-change procedure
The Change DB password button in the MMA main window and the order of steps (edit in Configure MMDB, validate, restart) need product confirmation before they are documented. Do not publish default passwords.
Troubleshooting¶
The server fails to start with a database error
Check server\logs\server.log for lines tagged MMDB-SVC, the PostgreSQL log in server\data\mmdb\logs\, and the migration record server\config\mmdb-service-state.json. Make sure no other program uses port 49614.
The InfolytikPostgres service exists but will not start
Check the Windows Event Log and the PostgreSQL log. Windows restarts the service automatically up to three times after a failure.
Do not copy another server's configuration
The embedded database expects host localhost in config.json. Copying config.json from a different machine can point MMS at the wrong database. See Moving to a New Server.