1
0
mirror of https://github.com/minio/docs.git synced 2025-04-22 19:02:57 +03:00
Ravind Kumar 4edb3f7bae
Improve documentation on MINIO_DOMAIN (#1131)
# Summary

As per a recent customer issue, our guidance on `MINIO_DOMAIN` and
path/virtual bucket lookups needs some attention.

There are two main areas to address:

1. We need to guide users to avoid namespace collision within the
`MINIO_DOMAIN` , as this causes bucket lookup issues with certain MinIO
services/features
2. We need to generally improve docs on setting `MINIO_DOMAIN` correctly

There is also a side objective from Engineering to ensure we have a
simple admonition to direct users to test wherever possible changes to
config settings before applying to production.

---------

Co-authored-by: Daryl White <53910321+djwfyi@users.noreply.github.com>
2024-02-14 17:16:58 -05:00

8.2 KiB

PostgreSQL Notification Settings

minio

Table of Contents

This page documents settings for configuring an POSTGRES service as a target for Bucket Notifications <minio-bucket-notifications>. See minio-bucket-notifications-publish-postgresql for a tutorial on using these settings.

Multiple PostgreSQL Targets

You can specify multiple PostgreSQL service endpoints by appending a unique identifier _ID for each set of related PostgreSQL settings on to the top level key. For example, the following commands set two distinct PostgreSQL service endpoints as PRIMARY and SECONDARY respectively:

Environment Variables

set MINIO_NOTIFY_POSTGRES_ENABLE_PRIMARY="on"
set MINIO_NOTIFY_POSTGRES_CONNECTION_STRING_PRIMARY="host=postgresql-endpoint.example.net port=4222..."
set MINIO_NOTIFY_POSTGRES_TABLE_PRIMARY="minioevents"
set MINIO_NOTIFY_POSTGRES_FORMAT_PRIMARY="namespace"

set MINIO_NOTIFY_POSTGRES_ENABLE_SECONDARY="on"
set MINIO_NOTIFY_POSTGRES_CONNECTION_STRING_SECONDARY="host=postgresql-endpoint.example.net port=4222..."
set MINIO_NOTIFY_POSTGRES_TABLE_SECONDARY="minioevents"
set MINIO_NOTIFY_POSTGRES_FORMAT_SECONDARY="namespace"

Configuration Settings

mc admin config set notify_postgres:primary \ 
   connection_string="host=postgresql.example.com port=5432..."
   table="minioevents" \
   format="namespace" \
   [ARGUMENT=VALUE ...]

mc admin config set notify_postgres:secondary \
   connection_string="host=postgresql.example.com port=5432..."
   table="minioevents" \
   format="namespace" \
   [ARGUMENT=VALUE ...]

With these settings, MINIO_NOTIFY_POSTGRES_ENABLE_PRIMARY <MINIO_NOTIFY_POSTGRES_ENABLE> indicates the environment variable is associated to an PostgreSQL service endpoint with ID of PRIMARY.

Settings

Enable

Required

Environment Variable

MINIO_NOTIFY_POSTGRES_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:

  • MINIO_NOTIFY_POSTGRES_CONNECTION_STRING
  • MINIO_NOTIFY_POSTGRES_TABLE
  • MINIO_NOTIFY_POSTGRES_FORMAT

Configuration Setting

notify_postgres

The top-level configuration key for defining an PostgreSQL service endpoint for use with MinIO bucket notifications <minio-bucket-notifications>.

Use mc admin config set to set or update an PostgreSQL service endpoint. The following arguments are required for each target:

  • ~notify_postgres.connection_string
  • ~notify_postgres.table
  • ~notify_postgres.format

Specify additional optional arguments as a whitespace (" ")-delimited list.

mc admin config set notify_postgres                            \ 
  connection_string="host=postgresql.example.com port=5432..." \
  table="minioevents"                                          \
  format="namespace"                                           \
  [ARGUMENT="VALUE"] ... 

Connection String

Required

Environment Variable

MINIO_NOTIFY_POSTGRES_CONNECTION_STRING

Configuration Setting

notify_postgres connection_string

Specify the URI connection string of the PostgreSQL service endpoint. MinIO supports key=value format for the PostgreSQL connection string. For example:

"host=https://postgresql.example.com port=5432 ..."

For more complete documentation on supported PostgreSQL connection string parameters, see the PostgreSQL Connection Strings documentation.

Table

Required

Environment Variable

MINIO_NOTIFY_POSTGRES_TABLE

Configuration Setting

notify_postgres table

Specify the name of the PostgreSQL table to which MinIO publishes event notifications.

Format

Required

Environment Variable

MINIO_NOTIFY_POSTGRES_FORMAT

Configuration Setting

notify_postgres format

Specify the format of event data written to the PostgreSQL service endpoint. MinIO supports the following values:

namespace

For each bucket event, MinIO creates a JSON document with the bucket and object name from the event as the document ID and the actual event as part of the document body. Additional updates to that object modify the existing table entry for that object. Similarly, deleting the object also deletes the corresponding table entry.

access

For each bucket event, MinIO creates a JSON document with the event details and appends it to the table with a PostgreSQL-generated random ID. Additional updates to an object result in new index entries, and existing entries remain unmodified.

Max Open Connections

Optional

Environment Variable

MINIO_NOTIFY_POSTGRES_MAX_OPEN_CONNECTIONS

Configuration Setting

notify_postgres max_open_connections

Specify the maximum number of open connections to the PostgreSQL database.

Defaults to 2.

Queue Directory

Optional

Environment Variable

MINIO_NOTIFY_POSTGRES_QUEUE_DIR

Configuration Setting

notify_postgres queue_dir

Specify the directory path to enable MinIO's persistent event store for undelivered messages, such as /opt/minio/events.

MinIO stores undelivered events in the specified store while the PostgreSQL server/broker is offline and replays the stored events when connectivity resumes.

Queue Limit

Optional

Environment Variable

MINIO_NOTIFY_POSTGRES_QUEUE_LIMIT

Configuration Setting

notify_postgres queue_limit

Specify the maximum limit for undelivered messages. Defaults to 100000.

Comment

Optional

Environment Variable

MINIO_NOTIFY_POSTGRES_COMMENT

Configuration Setting

notify_postgres comment

Specify a comment to associate with the PostgreSQL configuration.