PostgreSQL Notification Settings
This page documents settings for configuring an POSTGRES service as a target for Bucket Notifications. See Publish Events to PostgreSQL for a tutorial on using these settings.
You can establish or modify settings by defining:
- an environment variable on the host system prior to starting or restarting the AIStor Server. Refer to your operating system’s documentation for how to define an environment variable.
- a configuration setting using
mc admin config set.
If you define both an environment variable and the similar configuration setting, MinIO AIStor uses the environment variable value.
Some settings have only an environment variable or a configuration setting, but not both.
Each configuration setting controls fundamental MinIO AIStor behavior and functionality. Test configuration changes in a lower environment, such as DEV or QA, before applying to production.
You can specify multiple targets by appending a unique identifier _ID for each set of related settings.
export MINIO_NOTIFY_POSTGRES_ENABLE_PRIMARY="on"
export MINIO_NOTIFY_POSTGRES_CONNECTION_STRING_PRIMARY="host=postgresql-endpoint.example.net port=5432 user=minio password=PASSWORD dbname=minio_events"
export MINIO_NOTIFY_POSTGRES_TABLE_PRIMARY="minioevents"
export MINIO_NOTIFY_POSTGRES_FORMAT_PRIMARY="namespace"
export MINIO_NOTIFY_POSTGRES_ENABLE_SECONDARY="on"
export MINIO_NOTIFY_POSTGRES_CONNECTION_STRING_SECONDARY="host=postgresql-endpoint.example.net port=5432 user=minio password=PASSWORD dbname=minio_events"
export MINIO_NOTIFY_POSTGRES_TABLE_SECONDARY="minioevents"
export MINIO_NOTIFY_POSTGRES_FORMAT_SECONDARY="namespace"You can specify multiple targets by appending a unique identifier :ID to the configuration key.
mc admin config set ALIAS notify_postgres:primary \
connection_string="host=postgresql.example.com port=5432 user=minio password=PASSWORD dbname=minio_events" \
table="minioevents" \
format="namespace" \
[ARGUMENT=VALUE ...]
mc admin config set ALIAS notify_postgres:secondary \
connection_string="host=postgresql.example.com port=5432 user=minio password=PASSWORD dbname=minio_events" \
table="minioevents" \
format="namespace" \
[ARGUMENT=VALUE ...]With these settings, MINIO_NOTIFY_POSTGRES_ENABLE_PRIMARY indicates the environment variable is associated to an PostgreSQL service endpoint with ID of PRIMARY.
Settings
Enable
Specify on to enable publishing bucket notifications to a PostgreSQL service endpoint.
Defaults to off.
Requires specifying the following additional environment variables if set to on:
The top-level configuration key for defining an PostgreSQL service endpoint for use with MinIO AIStor bucket notifications.
Use mc admin config set to set or update an PostgreSQL service endpoint.
The following arguments are required for each target:
Specify additional optional arguments as a whitespace (" ")-delimited list.
mc admin config set ALIAS notify_postgres \
connection_string="host=postgresql.example.com port=5432 user=minio password=PASSWORD dbname=minio_events" \
table="minioevents" \
format="namespace" \
[ARGUMENT="VALUE"] ...Connection string
Specify the PostgreSQL connection string to which MinIO AIStor publishes bucket events.
Table
Specify the name of the PostgreSQL table to which MinIO AIStor publishes event notifications.
Format
Specify the format of event data written to the PostgreSQL service endpoint.
Max open connections
The maximum number of open connections to the PostgreSQL database.
Defaults to 2.
Queue dir
Specify the directory path to enable MinIO’s persistent event store for undelivered messages, such as /opt/minio/events.
MinIO AIStor stores undelivered events in the specified store while the PostgreSQL server/broker is offline and replays the stored events when connectivity resumes.
Queue limit
Specify the maximum limit for undelivered messages. Defaults to 100000.
Comment
Specify a comment to associate with the PostgreSQL configuration.