This is the multi-page printable view of this section. .
Monitoring Bucket and Object Events
-
1: Bucket notifications
- 2: Publish Events to AMQP (RabbitMQ)
- 3: Publish Events to MQTT
- 4: Publish Events to NATS
- 5: Publish Events to NSQ
- 6: Publish Events to Elasticsearch
- 7: Publish Events to Kafka
- 8: Publish Events to MySQL
- 9: Publish Events to PostgreSQL
- 10: Publish Events to Redis
- 11: Publish Events to Webhook
Bucket Notifications
MinIO bucket notifications allow administrators to send notifications to supported external services on certain object or bucket events. MinIO supports bucket and object-level S3 events similar to the Amazon S3 Event Notifications.
MinIO supports publishing bucket or object events to the following supported targets on certain supported events.
- Publish Events to AMQP (RabbitMQ)
- Publish Events to MQTT
- Publish Events to NATS
- Publish Events to NSQ
- Publish Events to Elasticsearch
- Publish Events to Kafka
- Publish Events to MySQL
- Publish Events to PostgreSQL
- Publish Events to Redis
- Publish Events to Webhook
See Bucket notifications for more complete documentation on MinIO Bucket Notifications.
Deployment Metrics
MinIO provides a Prometheus-compatible endpoint for supporting time-series querying of metrics.
Server Logs
MinIO provides the following interfaces for remotely reading server logs:
- The
mc admin logscommand returns the specified server’s console output. - MinIO supports pushing server logs to an HTTP webhook for further ingestion. See Publish Server Logs to HTTP Webhook for more information.
1 - Bucket notifications
MinIO bucket notifications allow administrators to send notifications to supported external services on certain object or bucket events. MinIO supports bucket and object-level S3 events similar to the Amazon S3 Event Notifications.
Supported notification targets
MinIO supports publishing event notifications to the following targets:
Target |
Description |
|---|---|
AMQP (RabbitMQ) |
Publish notifications to an AMQP service such as RabbitMQ. See Publish Events to AMQP (RabbitMQ) for a tutorial. |
MQTT |
Publish notifications to an MQTT service. See Publish Events to MQTT for a tutorial. |
NATS |
Publish notifications to a NATS service. See Publish Events to NATS for a tutorial. |
NSQ |
Publish notifications to a NSQ service. See Publish Events to NSQ for a tutorial |
Elasticsearch |
Publish notifications to a Elasticsearch service. See Publish Events to Elasticsearch for a tutorial. |
Kafka |
Publish notifications to a Kafka service. See Publish Events to Kafka for a tutorial. |
MySQL |
Publish notifications to a MySQL service. See Publish Events to MySQL for a tutorial. |
PostgreSQL |
Publish notifications to a PostgreSQL service. See Publish Events to PostgreSQL for a tutorial. |
Redis |
Publish notifications to a Redis service. See Publish Events to Redis for a tutorial. |
webhook |
Publish notifications to a Webhook service. See Publish Events to Webhook for a tutorial. |
Asynchronous vs synchronous bucket notifications
Added: RELEASE.2023-06-23T20-26-00Z
MinIO supports either asynchronous (default) or synchronous bucket notifications for all remote targets.
With asynchronous delivery, MinIO fires the event at the configured remote and does not wait for a response before continuing to the next event. Asynchronous bucket notification prioritizes sending events with the risk of some events being lost if the remote target has a transient issue during transit or processing.
With synchronous delivery, MinIO fires the event at the configured remote and then waits for the remote to confirm a successful receipt before continuing to the next event. Synchronous bucket notification prioritizes delivery of events with the risk of a slower event-send rate and queue fill.
To enable synchronous bucket notifications for all configured remote targets, use either of the following settings:
- Set the
MINIO_API_SYNC_EVENTSenvironment variable toonand restart the MinIO deployment. - Set the
api.sync_eventsconfiguration setting toonand restart the MinIO deployment.
Note
For synchronous and asynchronous events, MinIO maintains a per-remote queue where it stores unsent and pending events. The queue limit defaults to 100000.
MinIO discards new events when the queue is full.
You can increase the queue size as necessary to better accommodate the rate of event send and processing of the MinIO deployment and remote target. Use the QUEUE_LIMIT environment variable or configuration setting for your notification method to modify this limit.
For asynchronous events, MinIO allows a maximum of 50000 concurrent send calls.
Supported S3 event types
MinIO bucket notifications are compatible with Amazon S3 Event Notifications. This section lists all supported events.
Object events
MinIO supports triggering notifications on the following S3 object events:
s3:ObjectAccessed:Get
data
s3:ObjectAccessed:GetLegalHold
data
s3:ObjectAccessed:GetRetention
data
s3:ObjectAccessed:Head
data
s3:ObjectCreated:CompleteMultipartUpload
data
s3:ObjectCreated:Copy
data
s3:ObjectCreated:DeleteTagging
data
s3:ObjectCreated:Post
data
s3:ObjectCreated:Put
data
s3:ObjectCreated:PutLegalHold
data
s3:ObjectCreated:PutRetention
data
s3:ObjectCreated:PutTagging
data
s3:ObjectRemoved:Delete
data
s3:ObjectRemoved:DeleteMarkerCreated
data
Specify the wildcard * character to select all events related to a prefix:
s3:ObjectAccessed:*
data
Selects all s3:ObjectAccessed -prefixed events.
s3:ObjectCreated:*
data
Selects all s3:ObjectCreated -prefixed events.
s3:ObjectRemoved:*
data
Selects all s3:ObjectRemoved -prefixed events.
Replication events
MinIO supports triggering notifications on the following S3 replication events:
s3:Replication:OperationCompletedReplication
data
s3:Replication:OperationFailedReplication
data
s3:Replication:OperationMissedThreshold
data
s3:Replication:OperationNotTracked
data
s3:Replication:OperationReplicatedAfterThreshold
data
Specify the wildcard * character to select all s3:Replication events:
s3:Replication:*
data
ILM transition events
MinIO supports triggering notifications on the following S3 ILM transition events:
s3:ObjectRestore:Post
data
s3:ObjectRestore:Completed
data
s3:ObjectTransition:Failed
data
s3:ObjectTransition:Complete
data
Specify the wildcard * character to select all events related to a prefix:
s3:ObjectTransition:*
data
Selects all s3:ObjectTransition -prefixed events.
s3:ObjectRestore:*
data
Selects all s3:ObjectRestore -prefixed events.
Scanner events
MinIO supports triggering notifications on the following S3 scanner transition events:
s3:Scanner:ManyVersions
data
Scanner finds objects with more than 1,000 versions.
s3:Scanner:BigPrefix
data
Scanner finds prefixes with more than 50,000 sub-folders.
Global events
MinIO supports triggering notifications on the following global events. You can only listen to these events through the ListenNotification API:
s3:BucketCreated
data
s3:BucketRemoved
data
Payload schema
All notification payloads use the same overall schema. Depending on the type of notification, some fields may be omitted or have null values.
Example
The following example is a notification for an s3:ObjectCreated:Put event:
2 - Publish Events to AMQP (RabbitMQ)
MinIO supports publishing bucket notification events to a AMQP 0-9-1 service endpoint such as RabbitMQ.
MinIO relies on the https://github.com/streadway/amqp project for AMQP connectivity. The project is primarily tested against RabbitMQ deployments, though other AMQP 0-9-1-compatible services may also work. The procedures on this page assume a RabbitMQ deployment using the AMQP 0-9-1 protocol as the service endpoint.
Add an AMQP Endpoint to a MinIO Deployment
The following procedure adds a new AMQP service endpoint for supporting bucket notifications in a MinIO deployment.
Prerequisites
AMQP 0-9-1 Service Endpoint
MinIO relies on the https://github.com/streadway/amqp project for AMQP connectivity. The project is primarily tested against RabbitMQ deployments, though other AMQP 0-9-1-compatible services may also work. This procedure assumes a RabbitMQ deployment using the 0-9-1 protocol as the service endpoint.
If the AMQP service requires authentication, you must provide an appropriate username and password during the configuration process to grant MinIO access to the service.
MinIO mc Command Line Tool
This procedure uses the mc command line tool for certain actions. See the mc Quickstart for installation instructions.
1) Add the AMQP Endpoint to MinIO
You can configure a new AMQP service endpoint using either environment variables or by setting runtime configuration settings.
MinIO supports specifying the AMQP service endpoint and associated configuration settings using environment variables. The minio server process applies the specified settings on its next startup.
The following example code sets all environment variables related to configuring an AMQP service endpoint. The minimum required variables are MINIO_NOTIFY_AMQP_ENABLE and MINIO_NOTIFY_AMQP_URL:
Windows
Linux and macOS
-
Replace
<IDENTIFIER>with a unique descriptive string for the AMQP service endpoint. Use the same<IDENTIFIER>value for all environment variables related to the new AMQP service endpoint. The following examples assume an identifier ofPRIMARY.If the specified
<IDENTIFIER>matches an existing AMQP service endpoint on the MinIO deployment, the new settings override any existing settings for that endpoint. Usemc admin config get notify_amqpto review the currently configured AMQP endpoints on the MinIO deployment. -
Replace
<ENDPOINT>with the URL of the AMQP service endpoint. For example:amqp://user:password@hostname:port
See AMQP Service for Bucket Notifications for complete documentation on each environment variable.
MinIO supports adding or updating AMQP endpoints on a running minio server process using the mc admin config set command and the notify_amqp configuration key. You must restart the minio server process to apply any new or updated configuration settings.
The following example code sets all settings related to configuring an AMQP service endpoint. The minimum required setting is notify_amqp url:
-
Replace
IDENTIFIERwith a unique descriptive string for the AMQP service endpoint. The following examples in this procedure assume an identifier ofPRIMARY.If the specified
IDENTIFIERmatches an existing AMQP service endpoint on the MinIO deployment, the new settings override any existing settings for that endpoint. Usemc admin config get notify_amqpto review the currently configured AMQP endpoints on the MinIO deployment. -
Replace
ENDPOINTwith the URL of the AMQP service endpoint. For example:amqp://user:password@hostname:port
See AMQP Bucket Notification Configuration Settings for complete documentation on each setting.
1) Restart the MinIO Deployment
You must restart the MinIO deployment to apply the configuration changes. Use the mc admin service restart command to restart the deployment.
Replace ALIAS with the alias of the deployment to restart.
The minio server process prints a line on startup for each configured AMQP target similar to the following:
You must specify the ARN resource when configuring bucket notifications with the associated AMQP deployment as a target.
Identifying the ARN for your bucket notifications
You defined the <IDENTIFIER> to assign to the target ARN for your bucket notifications when creating the endpoint previously. The steps below return the ARNs configured on the deployment. Identify the ARN created previously by looking for the <IDENTIFIER> you specified.
Review the JSON output
-
Copy and run the following command, replacing
ALIASwith the alias of the deployment. -
In the JSON output, look for the key
info.sqsARN.The ARN you need is the value of that key that matches the
<IDENTIFIER>you specified.For example,
arn:minio:sqs::primary:amqp.
Use jq to parse the JSON for the value
-
Copy and run the following command, replacing
ALIASwith the alias of the deployment.This returns the ARN to use for notifications, such as
arn:minio:sqs::primary:amqp
3) Configure Bucket Notifications using the AMQP Endpoint as a Target
Use the mc event add command to add a new bucket notification event with the configured AMQP service as a target:
- Replace
ALIASwith the alias of a MinIO deployment. - Replace
BUCKETwith the name of the bucket in which to configure the event. - Replace
EVENTSwith a comma-separated list of events for which MinIO triggers notifications.
Use mc event ls to view all configured bucket events for a given notification target:
4) Validate the Configured Events
Perform an action on the bucket for which you configured the new event and check the AMQP service for the notification data. The action required depends on which events were specified when configuring the bucket notification.
For example, if the bucket notification configuration includes the s3:ObjectCreated:Put event, you can use the mc cp command to create a new object in the bucket and trigger a notification.
Update an AMQP Endpoint in a MinIO Deployment
The following procedure updates an existing AMQP service endpoint for supporting bucket notifications in a MinIO deployment.
Prerequisites
AMQP 0-9-1 Service Endpoint
MinIO relies on the https://github.com/streadway/amqp project for AMQP connectivity. The project is primarily tested against RabbitMQ deployments, though other AMQP 0-9-1-compatible services may also work. This procedure assumes a RabbitMQ deployment as the service endpoint.
If the AMQP service requires authentication, you must provide an appropriate username and password during the configuration process to grant MinIO access to the service.
MinIO mc Command Line Tool
This procedure uses the mc command line tool for certain actions. See the mc Quickstart for installation instructions.
1) List Configured AMQP Endpoints In The Deployment
Use the mc admin config get command to list the currently configured AMQP service endpoints in the deployment:
Replace ALIAS with the alias of the MinIO deployment.
The command output resembles the following:
The notify_amqp key is the top-level configuration key for an AMQP Notification Settings. The url key specifies the AMQP service endpoint for the given notify_amqp key. The notify_amqp:<IDENTIFIER> suffix describes the unique identifier for that AMQP service endpoint.
Note the identifier for the AMQP service endpoint you want to update for the next step.
2) Update the AMQP Endpoint
Use the mc admin config set command to set the new configuration for the AMQP service endpoint:
The notify_amqp url configuration setting is the minimum required for an AMQP service endpoint. All other configuration settings are optional. See AMQP Notification Settings for a complete list of AMQP configuration settings.
3) Restart the MinIO Deployment
You must restart the MinIO deployment to apply the configuration changes. Use the mc admin service restart command to restart the deployment.
Replace ALIAS with the alias of the deployment to restart.
The minio server process prints a line on startup for each configured AMQP target similar to the following:
4) Validate the Changes
Perform an action on a bucket which has an event configuration using the updated AMQP service endpoint and check the AMQP service for the notification data. The action required depends on which events were specified when configuring the bucket notification.
For example, if the bucket notification configuration includes the s3:ObjectCreated:Put event, you can use the mc cp command to create a new object in the bucket and trigger a notification.
3 - Publish Events to MQTT
MinIO supports publishing bucket notification events to MQTT server/broker endpoint.
Add an MQTT Endpoint to a MinIO Deployment
The following procedure adds a new MQTT service endpoint for supporting bucket notifications in a MinIO deployment.
Prerequisites
MQTT 3.1 or 3.1.1 Server/Broker
This procedure assumes an existing MQTT 3.1 or 3.1.1 server/broker to which the MinIO deployment has connectivity. See the mqtt.org software listing for a list of MQTT-compatible server/brokers.
If the MQTT service requires authentication, you must provide an appropriate username and password during the configuration process to grant MinIO access to the service.
MinIO mc Command Line Tool
This procedure uses the mc command line tool for certain actions. See the mc Quickstart for installation instructions.
1) Add the MQTT Endpoint to MinIO
You can configure a new MQTT service endpoint using either environment variables or by setting runtime configuration settings.
MinIO supports specifying the MQTT service endpoint and associated configuration settings using environment variables. The minio server process applies the specified settings on its next startup.
The following example code sets all environment variables related to configuring an MQTT service endpoint. The minimum required variables are:
MINIO_NOTIFY_MQTT_ENABLEMINIO_NOTIFY_MQTT_BROKERMINIO_NOTIFY_MQTT_TOPICMINIO_NOTIFY_MQTT_USERNAMERequired if the MQTT server/broker enforces authentication/authorizationMINIO_NOTIFY_MQTT_PASSWORDRequired if the MQTT server/broker enforces authentication/authorization
Windows
Linux and macOS
-
Replace
<IDENTIFIER>with a unique descriptive string for the MQTT service endpoint. Use the same<IDENTIFIER>value for all environment variables related to the new MQTT service endpoint. The following examples assume an identifier ofPRIMARY.If the specified
<IDENTIFIER>matches an existing MQTT service endpoint on the MinIO deployment, the new settings override any existing settings for that endpoint. Usemc admin config get notify_mqttto review the currently configured MQTT endpoints on the MinIO deployment. -
Replace
<ENDPOINT>with the URL of the MQTT service endpoint. For example:tcp://hostname:port -
Replace
TOPICwith the MQTT topic to which MinIO associates events published to the server/broker.
See MQTT Service for Bucket Notifications for complete documentation on each environment variable.
MinIO supports adding or updating MQTT endpoints on a running minio server process using the mc admin config set command and the notify_mqtt configuration key. You must restart the minio server process to apply any new or updated configuration settings.
The following example code sets all settings related to configuring an MQTT service endpoint. The following configuration settings are the minimum required for an MQTT server/broker endpoint:
brokertopicusernameRequired if the MQTT server/broker enforces authentication/authorizationpasswordRequired if the MQTT server/broker enforces authentication/authorization
-
Replace
IDENTIFIERwith a unique descriptive string for the MQTT service endpoint. The following examples in this procedure assume an identifier ofPRIMARY.If the specified
IDENTIFIERmatches an existing MQTT service endpoint on the MinIO deployment, the new settings override any existing settings for that endpoint. Usemc admin config get notify_mqttto review the currently configured MQTT endpoints on the MinIO deployment. -
Replace
ENDPOINTwith the URL of the MQTT service endpoint. For example:tcp://hostname:port -
Replace
TOPICwith the MQTT topic to which MinIO associates events published to the server/broker.
See MQTT Bucket Notification Configuration Settings for complete documentation on each setting.
1) Restart the MinIO Deployment
You must restart the MinIO deployment to apply the configuration changes. Use the mc admin service restart command to restart the deployment.
Replace ALIAS with the alias of the deployment to restart.
The minio server process prints a line on startup for each configured MQTT target similar to the following:
You must specify the ARN resource when configuring bucket notifications with the associated MQTT deployment as a target.
Identifying the ARN for your bucket notifications
You defined the <IDENTIFIER> to assign to the target ARN for your bucket notifications when creating the endpoint previously. The steps below return the ARNs configured on the deployment. Identify the ARN created previously by looking for the <IDENTIFIER> you specified.
Review the JSON output
-
Copy and run the following command, replacing
ALIASwith the alias of the deployment. -
In the JSON output, look for the key
info.sqsARN.The ARN you need is the value of that key that matches the
<IDENTIFIER>you specified.For example,
arn:minio:sqs::primary:mqtt.
Use jq to parse the JSON for the value
-
Copy and run the following command, replacing
ALIASwith the alias of the deployment.This returns the ARN to use for notifications, such as
arn:minio:sqs::primary:mqtt
1) Configure Bucket Notifications using the MQTT Endpoint as a Target
Use the mc event add command to add a new bucket notification event with the configured MQTT service as a target:
- Replace
ALIASwith the alias of a MinIO deployment. - Replace
BUCKETwith the name of the bucket in which to configure the event. - Replace
EVENTSwith a comma-separated list of events for which MinIO triggers notifications.
Use mc event ls to view all configured bucket events for a given notification target:
4) Validate the Configured Events
Perform an action on the bucket for which you configured the new event and check the MQTT service for the notification data. The action required depends on which events were specified when configuring the bucket notification.
For example, if the bucket notification configuration includes the s3:ObjectCreated:Put event, you can use the mc cp command to create a new object in the bucket and trigger a notification.
Update an MQTT Endpoint in a MinIO Deployment
The following procedure updates an existing MQTT service endpoint for supporting bucket notifications in a MinIO deployment.
Prerequisites
MQTT 3.1 or 3.1.1 Server/Broker Endpoint
This procedure assumes an existing MQTT 3.1 or 3.1.1 server/broker to which the MinIO deployment has connectivity. See the mqtt.org software listing for a list of MQTT-compatible server/brokers.
If the MQTT service requires authentication, you must provide an appropriate username and password during the configuration process to grant MinIO access to the service.
MinIO mc Command Line Tool
This procedure uses the mc command line tool for certain actions. See the mc Quickstart for installation instructions.
1) List Configured MQTT Endpoints In The Deployment
Use the mc admin config get command to list the currently configured MQTT service endpoints in the deployment:
Replace ALIAS with the alias of the MinIO deployment.
The command output resembles the following:
The notify_mqtt key is the top-level configuration key for an MQTT Notification Settings. The broker key specifies the MQTT server/broker endpoint for the given notify_mqtt key. The notify_mqtt:<IDENTIFIER> suffix describes the unique identifier for that MQTT service endpoint.
Note the identifier for the MQTT service endpoint you want to update for the next step.
2) Update the MQTT Endpoint
Use the mc admin config set command to set the new configuration for the MQTT service endpoint:
The following configuration settings are the minimum required for an MQTT server/broker endpoint:
brokertopicusernameRequired if the MQTT server/broker enforces authentication/authorizationpasswordRequired if the MQTT server/broker enforces authentication/authorization
All other configuration settings are optional. See MQTT Notification Settings for a complete list of MQTT configuration settings.
3) Restart the MinIO Deployment
You must restart the MinIO deployment to apply the configuration changes. Use the mc admin service restart command to restart the deployment.
Replace ALIAS with the alias of the deployment to restart.
The minio server process prints a line on startup for each configured MQTT target similar to the following:
3) Validate the Changes
Perform an action on a bucket which has an event configuration using the updated MQTT service endpoint and check the MQTT service for the notification data. The action required depends on which events were specified when configuring the bucket notification.
For example, if the bucket notification configuration includes the s3:ObjectCreated:Put event, you can use the mc cp command to create a new object in the bucket and trigger a notification.
4 - Publish Events to NATS
MinIO supports publishing bucket notification events to a NATS service endpoint.
NATS Streaming Deprecated
NATS Streaming is deprecated. Migrate to JetStream instead.
The related MinIO configuration options and environment variables are deprecated.
Add a NATS Endpoint to a MinIO Deployment
The following procedure adds a new NATS service endpoint for supporting bucket notifications in a MinIO deployment.
Prerequisites
MinIO mc Command Line Tool
This procedure uses the mc command line tool for certain actions. See the mc Quickstart for installation instructions.
1) Add the NATS Endpoint to MinIO
You can configure a new NATS service endpoint using either environment variables or by setting runtime configuration settings.
MinIO supports specifying the NATS service endpoint and associated configuration settings using environment variables. The minio server process applies the specified settings on its next startup.
The following example code sets all environment variables related to configuring an NATS service endpoint. The minimum required variables are MINIO_NOTIFY_NATS_ADDRESS and MINIO_NOTIFY_NATS_SUBJECT:
Windows
Linux and macOS
-
Replace
<IDENTIFIER>with a unique descriptive string for the NATS service endpoint. Use the same<IDENTIFIER>value for all environment variables related to the new target service endpoint. The following examples assume an identifier ofPRIMARY.If the specified
<IDENTIFIER>matches an existing NATS service endpoint on the MinIO deployment, the new settings override any existing settings for that endpoint. Usemc admin config get notify_natsto review the currently configured NATS endpoints on the MinIO deployment. -
Replace
<ENDPOINT>with the hostname and port of the NATS service endpoint. For example:nats-endpoint.example.com:4222
See NATS Service for Bucket Notifications for complete documentation on each environment variable.
MinIO supports adding or updating NATS endpoints on a running minio server process using the mc admin config set command and the notify_nats configuration key. You must restart the minio server process to apply any new or updated configuration settings.
The following example code sets all settings related to configuring an NATS service endpoint. The minimum required setting are notify_nats address and notify_nats subject:
-
Replace
IDENTIFIERwith a unique descriptive string for the NATS service endpoint. The following examples in this procedure assume an identifier ofPRIMARY.If the specified
IDENTIFIERmatches an existing NATS service endpoint on the MinIO deployment, the new settings override any existing settings for that endpoint. Usemc admin config get notify_natsto review the currently configured NATS endpoints on the MinIO deployment. -
Replace
ENDPOINTwith the hostname and port of the NATS service endpoint. For example:nats-endpoint.example.com:4222.
See NATS Bucket Notification Configuration Settings for complete documentation on each setting.
1) Restart the MinIO Deployment
You must restart the MinIO deployment to apply the configuration changes. Use the mc admin service restart command to restart the deployment.
Replace ALIAS with the alias of the deployment to restart.
The minio server process prints a line on startup for each configured NATS target similar to the following:
You must specify the ARN resource when configuring bucket notifications with the associated NATS deployment as a target.
Identifying the ARN for your bucket notifications
You defined the <IDENTIFIER> to assign to the target ARN for your bucket notifications when creating the endpoint previously. The steps below return the ARNs configured on the deployment. Identify the ARN created previously by looking for the <IDENTIFIER> you specified.
Review the JSON output
-
Copy and run the following command, replacing
ALIASwith the alias of the deployment. -
In the JSON output, look for the key
info.sqsARN.The ARN you need is the value of that key that matches the
<IDENTIFIER>you specified.For example,
arn:minio:sqs::primary:nats.
Use jq to parse the JSON for the value
-
Copy and run the following command, replacing
ALIASwith the alias of the deployment.This returns the ARN to use for notifications, such as
arn:minio:sqs::primary:nats
3) Configure Bucket Notifications using the NATS Endpoint as a Target
Use the mc event add command to add a new bucket notification event with the configured NATS service as a target:
- Replace
ALIASwith the alias of a MinIO deployment. - Replace
BUCKETwith the name of the bucket in which to configure the event. - Replace
EVENTSwith a comma-separated list of events for which MinIO triggers notifications.
Use mc event ls to view all configured bucket events for a given notification target:
4) Validate the Configured Events
Perform an action on the bucket for which you configured the new event and check the NATS service for the notification data. The action required depends on which events were specified when configuring the bucket notification.
For example, if the bucket notification configuration includes the s3:ObjectCreated:Put event, you can use the mc cp command to create a new object in the bucket and trigger a notification.
Update an NATS Endpoint in a MinIO Deployment
The following procedure updates an existing NATS service endpoint for supporting bucket notifications in a MinIO deployment.
Prerequisites
MinIO mc Command Line Tool
This procedure uses the mc command line tool for certain actions. See the mc Quickstart for installation instructions.
1) List Configured NATS Endpoints In The Deployment
Use the mc admin config get command to list the currently configured NATS service endpoints in the deployment:
Replace ALIAS with the alias of the MinIO deployment.
The command output resembles the following:
The notify_nats key is the top-level configuration key for an NATS Notification Settings. The address key specifies the NATS service endpoint for the given notify_nats key. The notify_nats:<IDENTIFIER> suffix describes the unique identifier for that NATS service endpoint.
Note the identifier for the NATS service endpoint you want to update for the next step.
2) Update the NATS Endpoint
Use the mc admin config set command to set the new configuration for the NATS service endpoint:
The notify_nats address configuration setting is the minimum required for an NATS service endpoint. All other configuration settings are optional. See NATS Notification Settings for a complete list of NATS configuration settings.
3) Restart the MinIO Deployment
You must restart the MinIO deployment to apply the configuration changes. Use the mc admin service restart command to restart the deployment.
Replace ALIAS with the alias of the deployment to restart.
The minio server process prints a line on startup for each configured NATS target similar to the following:
4) Validate the Changes
Perform an action on a bucket which has an event configuration using the updated NATS service endpoint and check the NATS service for the notification data. The action required depends on which events were specified when configuring the bucket notification.
For example, if the bucket notification configuration includes the s3:ObjectCreated:Put event, you can use the mc cp command to create a new object in the bucket and trigger a notification.
5 - Publish Events to NSQ
MinIO supports publishing bucket notification events to NSQ service endpoint.
Add a NSQ Endpoint to a MinIO Deployment
The following procedure adds a new NSQ service endpoint for supporting bucket notifications in a MinIO deployment.
Prerequisites
MinIO mc Command Line Tool
This procedure uses the mc command line tool for certain actions. See the mc Quickstart for installation instructions.
1) Add the NSQ Endpoint to MinIO
You can configure a new NSQ service endpoint using either environment variables or by setting runtime configuration settings.
MinIO supports specifying the NSQ service endpoint and associated configuration settings using environment variables. The minio server process applies the specified settings on its next startup.
The following example code sets all environment variables related to configuring an NSQ service endpoint. The minimum required variables are MINIO_NOTIFY_NSQ_NSQD_ADDRESS and MINIO_NOTIFY_NSQ_TOPIC:
Windows
Linux and macOS
-
Replace
<IDENTIFIER>with a unique descriptive string for the TARGET service endpoint. Use the same<IDENTIFIER>value for all environment variables related to the new target service endpoint. The following examples assume an identifier ofPRIMARY.If the specified
<IDENTIFIER>matches an existing NSQ service endpoint on the MinIO deployment, the new settings override any existing settings for that endpoint. Usemc admin config get notify_nsqto review the currently configured NSQ endpoints on the MinIO deployment. -
Replace
<ENDPOINT>with the URL of the NSQ service endpoint. For example,https://nsq-service.example.com:4150.
See NSQ Service for Bucket Notifications for complete documentation on each environment variable.
MinIO supports adding or updating NSQ endpoints on a running minio server process using the mc admin config set command and the notify_nsq configuration key. You must restart the minio server process to apply any new or updated configuration settings.
The following example code sets all settings related to configuring an NSQ service endpoint. The minimum required setting is notify_nsq nsqd_address and notify_nsq topic:
-
Replace
IDENTIFIERwith a unique descriptive string for the NSQ service endpoint. The following examples in this procedure assume an identifier ofPRIMARY.If the specified
IDENTIFIERmatches an existing NSQ service endpoint on the MinIO deployment, the new settings override any existing settings for that endpoint. Usemc admin config get notify_nsqto review the currently configured NSQ endpoints on the MinIO deployment. -
Replace
ENDPOINTwith the URL of the NSQ service endpoint. For example:NSQ://user:password@hostname:port
See NSQ Bucket Notification Configuration Settings for complete documentation on each setting.
1) Restart the MinIO Deployment
You must restart the MinIO deployment to apply the configuration changes. Use the mc admin service restart command to restart the deployment.
Replace ALIAS with the alias of the deployment to restart.
The minio server process prints a line on startup for each configured NSQ target similar to the following:
You must specify the ARN resource when configuring bucket notifications with the associated NSQ deployment as a target.
Identifying the ARN for your bucket notifications
You defined the <IDENTIFIER> to assign to the target ARN for your bucket notifications when creating the endpoint previously. The steps below return the ARNs configured on the deployment. Identify the ARN created previously by looking for the <IDENTIFIER> you specified.
Review the JSON output
-
Copy and run the following command, replacing
ALIASwith the alias of the deployment. -
In the JSON output, look for the key
info.sqsARN.The ARN you need is the value of that key that matches the
<IDENTIFIER>you specified.For example,
arn:minio:sqs::primary:nsq.
Use jq to parse the JSON for the value
-
Copy and run the following command, replacing
ALIASwith the alias of the deployment.This returns the ARN to use for notifications, such as
arn:minio:sqs::primary:nsq
3) Configure Bucket Notifications using the NSQ Endpoint as a Target
Use the mc event add command to add a new bucket notification event with the configured NSQ service as a target:
- Replace
ALIASwith the alias of a MinIO deployment. - Replace
BUCKETwith the name of the bucket in which to configure the event. - Replace
EVENTSwith a comma-separated list of events for which MinIO triggers notifications.
Use mc event ls to view all configured bucket events for a given notification target:
4) Validate the Configured Events
Perform an action on the bucket for which you configured the new event and check the NSQ service for the notification data. The action required depends on which events were specified when configuring the bucket notification.
For example, if the bucket notification configuration includes the s3:ObjectCreated:Put event, you can use the mc cp command to create a new object in the bucket and trigger a notification.
Update an NSQ Endpoint in a MinIO Deployment
The following procedure updates an existing NSQ service endpoint for supporting bucket notifications in a MinIO deployment.
Prerequisites
MinIO mc Command Line Tool
This procedure uses the mc command line tool for certain actions. See the mc Quickstart for installation instructions.
1) List Configured NSQ Endpoints In The Deployment
Use the mc admin config get command to list the currently configured NSQ service endpoints in the deployment:
Replace ALIAS with the alias of the MinIO deployment.
The command output resembles the following:
The notify_nsq key is the top-level configuration key for an NSQ Notification Settings. The nsqd_address key specifies the NSQ service endpoint for the given notify_nsq key. The notify_nsq:<IDENTIFIER> suffix describes the unique identifier for that NSQ service endpoint.
Note the identifier for the NSQ service endpoint you want to update for the next step.
2) Update the NSQ Endpoint
Use the mc admin config set command to set the new configuration for the NSQ service endpoint:
The notify_nsq nsqd_address configuration setting is the minimum required for an NSQ service endpoint. All other configuration settings are optional. See NSQ Notification Settings for a complete list of NSQ configuration settings.
3) Restart the MinIO Deployment
You must restart the MinIO deployment to apply the configuration changes. Use the mc admin service restart command to restart the deployment.
Replace ALIAS with the alias of the deployment to restart.
The minio server process prints a line on startup for each configured NSQ target similar to the following:
4) Validate the Changes
Perform an action on a bucket which has an event configuration using the updated NSQ service endpoint and check the NSQ service for the notification data. The action required depends on which events were specified when configuring the bucket notification.
For example, if the bucket notification configuration includes the s3:ObjectCreated:Put event, you can use the mc cp command to create a new object in the bucket and trigger a notification.
6 - Publish Events to Elasticsearch
MinIO supports publishing bucket notification events to an Elasticsearch service endpoint.
MinIO relies on the https://github.com/elastic/go-elasticsearch v7 project for Elastic connectivity.
Add a Elasticsearch Endpoint to a MinIO Deployment
The following procedure adds a new Elasticsearch service endpoint for supporting bucket notifications in a MinIO deployment.
Prerequisites
Elasticsearch v7.0 and later
MinIO relies on the https://github.com/olivere/elastic v7 project for Elastic connectivity. The elastic/v7 library specifically targets Elasticsearch v7.0 and is not compatible with earlier Elasticsearch versions.
MinIO mc Command Line Tool
This procedure uses the mc command line tool for certain actions. See the mc Quickstart for installation instructions.
1) Add the Elasticsearch Endpoint to MinIO
You can configure a new Elasticsearch service endpoint using either environment variables or by setting runtime configuration settings.
MinIO supports specifying the Elasticsearch service endpoint and associated configuration settings using environment variables. The minio server process applies the specified settings on its next startup.
The following example code sets all environment variables related to configuring an Elasticsearch service endpoint. The minimum required variables are:
MINIO_NOTIFY_ELASTICSEARCH_ENABLEMINIO_NOTIFY_ELASTICSEARCH_URLMINIO_NOTIFY_ELASTICSEARCH_INDEXMINIO_NOTIFY_ELASTICSEARCH_FORMAT
Windows
Linux and macOS
-
Replace
<IDENTIFIER>with a unique descriptive string for the TARGET service endpoint. Use the same<IDENTIFIER>value for all environment variables related to the new target service endpoint. The following examples assume an identifier ofPRIMARY.If the specified
<IDENTIFIER>matches an existing Elasticsearch service endpoint on the MinIO deployment, the new settings override any existing settings for that endpoint. Usemc admin config get notify_elasticsearchto review the currently configured Elasticsearch endpoints on the MinIO deployment. -
Replace
<ENDPOINT>with the URL of the Elasticsearch service endpoint. For example:
See Elasticsearch Service for Bucket Notifications for complete documentation on each environment variable.
MinIO supports adding or updating Elasticsearch endpoints on a running minio server process using the mc admin config set command and the notify_elasticsearch configuration key. You must restart the minio server process to apply any new or updated configuration settings.
The following example code sets all settings related to configuring an Elasticsearch service endpoint. The minimum required settings are:
-
Replace
IDENTIFIERwith a unique descriptive string for the Elasticsearch service endpoint. The following examples in this procedure assume an identifier ofPRIMARY.If the specified
IDENTIFIERmatches an existing Elasticsearch service endpoint on the MinIO deployment, the new settings override any existing settings for that endpoint. Usemc admin config get notify_elasticsearchto review the currently configured Elasticsearch endpoints on the MinIO deployment. -
Replace
ENDPOINTwith the URL of the Elasticsearch service endpoint. For example:https://user:password@hostname:port
See Elasticsearch Bucket Notification Configuration Settings for complete documentation on each setting.
1) Restart the MinIO Deployment
You must restart the MinIO deployment to apply the configuration changes. Use the mc admin service restart command to restart the deployment.
Replace ALIAS with the alias of the deployment to restart.
The minio server process prints a line on startup for each configured Elasticsearch target similar to the following:
You must specify the ARN resource when configuring bucket notifications with the associated Elasticsearch deployment as a target.
Identifying the ARN for your bucket notifications
You defined the <IDENTIFIER> to assign to the target ARN for your bucket notifications when creating the endpoint previously. The steps below return the ARNs configured on the deployment. Identify the ARN created previously by looking for the <IDENTIFIER> you specified.
Review the JSON output
-
Copy and run the following command, replacing
ALIASwith the alias of the deployment. -
In the JSON output, look for the key
info.sqsARN.The ARN you need is the value of that key that matches the
<IDENTIFIER>you specified.For example,
arn:minio:sqs::primary:elasticsearch.
Use jq to parse the JSON for the value
-
Copy and run the following command, replacing
ALIASwith the alias of the deployment.This returns the ARN to use for notifications, such as
arn:minio:sqs::primary:elasticsearch
3) Configure Bucket Notifications using the Elasticsearch Endpoint as a Target
Use the mc event add command to add a new bucket notification event with the configured Elasticsearch service as a target:
- Replace
ALIASwith the alias of a MinIO deployment. - Replace
BUCKETwith the name of the bucket in which to configure the event. - Replace
EVENTSwith a comma-separated list of events for which MinIO triggers notifications.
Use mc event ls to view all configured bucket events for a given notification target:
4) Validate the Configured Events
Perform an action on the bucket for which you configured the new event and check the Elasticsearch service for the notification data. The action required depends on which events were specified when configuring the bucket notification.
For example, if the bucket notification configuration includes the s3:ObjectCreated:Put event, you can use the mc cp command to create a new object in the bucket and trigger a notification.
Update an Elasticsearch Endpoint in a MinIO Deployment
The following procedure updates an existing Elasticsearch service endpoint for supporting bucket notifications in a MinIO deployment.
Prerequisites
Elasticsearch v7.0 and later
MinIO relies on the https://github.com/olivere/elastic v7 project for Elastic connectivity. The elastic/v7 library specifically targets Elasticsearch v7.0 and is not compatible with earlier Elasticsearch versions.
MinIO mc Command Line Tool
This procedure uses the mc command line tool for certain actions. See the mc Quickstart for installation instructions.
1) List Configured Elasticsearch Endpoints In The Deployment
Use the mc admin config get command to list the currently configured Elasticsearch service endpoints in the deployment:
Replace ALIAS with the alias of the MinIO deployment.
The command output resembles the following:
The notify_elasticsearch key is the top-level configuration key for an Elasticsearch Notification Settings. The url key specifies the Elasticsearch service endpoint for the given notify_elasticsearch key. The notify_elasticsearch:<IDENTIFIER> suffix describes the unique identifier for that Elasticsearch service endpoint.
Note the identifier for the Elasticsearch service endpoint you want to update for the next step.
2) Update the Elasticsearch Endpoint
Use the mc admin config set command to set the new configuration for the Elasticsearch service endpoint:
The notify_elasticsearch url configuration setting is the minimum required for an Elasticsearch service endpoint. All other configuration settings are optional. See Elasticsearch Notification Settings for a complete list of Elasticsearch configuration settings.
3) Restart the MinIO Deployment
You must restart the MinIO deployment to apply the configuration changes. Use the mc admin service restart command to restart the deployment.
Replace ALIAS with the alias of the deployment to restart.
The minio server process prints a line on startup for each configured Elasticsearch target similar to the following:
4) Validate the Changes
Perform an action on a bucket which has an event configuration using the updated Elasticsearch service endpoint and check the Elasticsearch service for the notification data. The action required depends on which events were specified when configuring the bucket notification.
For example, if the bucket notification configuration includes the s3:ObjectCreated:Put event, you can use the mc cp command to create a new object in the bucket and trigger a notification.
7 - Publish Events to Kafka
MinIO supports publishing bucket notification events to a Kafka service endpoint.
MinIO relies on the https://github.com/Shopify/sarama project for Kafka connectivity and shares that project’s Kafka support. See the sarama Compatibility and API stability section for more details.
Add a Kafka Endpoint to a MinIO Deployment
The following procedure adds a new Kafka service endpoint for supporting bucket notifications in a MinIO deployment.
Prerequisites
Kafka Minimum Versions and Supported Versions
MinIO relies on the https://github.com/Shopify/sarama project for Kafka connectivity and shares that project’s Kafka support. See the sarama Compatibility and API stability section for more details.
MinIO mc Command Line Tool
This procedure uses the mc command line tool for certain actions. See the mc Quickstart for installation instructions.
1) Add the Kafka Endpoint to MinIO
You can configure a new Kafka service endpoint using either environment variables or by setting runtime configuration settings.
MinIO supports specifying the Kafka service endpoint and associated configuration settings using environment variables. The minio server process applies the specified settings on its next startup.
The following example code sets all environment variables related to configuring a Kafka service endpoint. The minimum required variables are MINIO_NOTIFY_KAFKA_ENABLE and MINIO_NOTIFY_KAFKA_BROKERS:
Windows
Linux and macOS
-
Replace
<IDENTIFIER>with a unique descriptive string for the Kafka service endpoint. Use the same<IDENTIFIER>value for all environment variables related to the new target service endpoint. The following examples assume an identifier ofPRIMARY.If the specified
<IDENTIFIER>matches an existing Kafka service endpoint on the MinIO deployment, the new settings override any existing settings for that endpoint. Usemc admin config get notify_kafkato review the currently configured Kafka endpoints on the MinIO deployment. -
Replace
<ENDPOINT>with a comma-separated list of Kafka brokers. For example:"kafka1.example.com:2021,kafka2.example.com:2021"
See Kafka Service for Bucket Notifications for complete documentation on each environment variable.
MinIO supports adding or updating Kafka endpoints on a running minio server process using the mc admin config set command and the notify_kafka configuration key. You must restart the minio server process to apply any new or updated configuration settings.
The following example code sets all settings related to configuring an Kafka service endpoint. The minimum required setting is notify_kafka brokers:
-
Replace
IDENTIFIERwith a unique descriptive string for the Kafka service endpoint. The following examples in this procedure assume an identifier ofPRIMARY.If the specified
IDENTIFIERmatches an existing Kafka service endpoint on the MinIO deployment, the new settings override any existing settings for that endpoint. Usemc admin config get notify_kafkato review the currently configured Kafka endpoints on the MinIO deployment. -
Replace
ENDPOINTwith a comma separated list of Kafka brokers. For example:"kafka1.example.com:2021,kafka2.example.com:2021"
See Kafka Bucket Notification Configuration Settings for complete documentation on each setting.
1) Restart the MinIO Deployment
You must restart the MinIO deployment to apply the configuration changes. Use the mc admin service restart command to restart the deployment.
Replace ALIAS with the alias of the deployment to restart.
The minio server process prints a line on startup for each configured Kafka target similar to the following:
You must specify the ARN resource when configuring bucket notifications with the associated Kafka deployment as a target.
Identifying the ARN for your bucket notifications
You defined the <IDENTIFIER> to assign to the target ARN for your bucket notifications when creating the endpoint previously. The steps below return the ARNs configured on the deployment. Identify the ARN created previously by looking for the <IDENTIFIER> you specified.
Review the JSON output
-
Copy and run the following command, replacing
ALIASwith the alias of the deployment. -
In the JSON output, look for the key
info.sqsARN.The ARN you need is the value of that key that matches the
<IDENTIFIER>you specified.For example,
arn:minio:sqs::primary:kafka.
Use jq to parse the JSON for the value
-
Copy and run the following command, replacing
ALIASwith the alias of the deployment.This returns the ARN to use for notifications, such as
arn:minio:sqs::primary:kafka
3) Configure Bucket Notifications using the Kafka Endpoint as a Target
Use the mc event add command to add a new bucket notification event with the configured Kafka service as a target:
- Replace
ALIASwith the alias of a MinIO deployment. - Replace
BUCKETwith the name of the bucket in which to configure the event. - Replace
EVENTSwith a comma-separated list of events for which MinIO triggers notifications.
Use mc event ls to view all configured bucket events for a given notification target:
4) Validate the Configured Events
Perform an action on the bucket for which you configured the new event and check the Kafka service for the notification data. The action required depends on which events were specified when configuring the bucket notification.
For example, if the bucket notification configuration includes the s3:ObjectCreated:Put event, you can use the mc cp command to create a new object in the bucket and trigger a notification.
Update a Kafka Endpoint in a MinIO Deployment
The following procedure updates an existing Kafka service endpoint for supporting bucket notifications in a MinIO deployment.
Prerequisites
Kafka Minimum Versions and Supported Versions
MinIO relies on the https://github.com/Shopify/sarama project for Kafka connectivity and shares that project’s Kafka support. See the sarama Compatibility and API stability section for more details.
MinIO mc Command Line Tool
This procedure uses the mc command line tool for certain actions. See the mc Quickstart for installation instructions.
1) List Configured Kafka Endpoints In The Deployment
Use the mc admin config get command to list the currently configured Kafka service endpoints in the deployment:
Replace ALIAS with the alias of the MinIO deployment.
The command output resembles the following:
The notify_kafka key is the top-level configuration key for an Kafka Notification Settings. The brokers key specifies the Kafka service endpoint for the given notify_kafka key. The notify_kafka:<IDENTIFIER> suffix describes the unique identifier for that Kafka service endpoint.
Note the identifier for the Kafka service endpoint you want to update for the next step.
2) Update the Kafka Endpoint
Use the mc admin config set command to set the new configuration for the Kafka service endpoint:
The notify_kafka brokers configuration setting is the minimum required for a Kafka service endpoint. All other configuration settings are optional. See Kafka Notification Settings for a complete list of Kafka configuration settings.
3) Restart the MinIO Deployment
You must restart the MinIO deployment to apply the configuration changes. Use the mc admin service restart command to restart the deployment.
Replace ALIAS with the alias of the deployment to restart.
The minio server process prints a line on startup for each configured Kafka target similar to the following:
4) Validate the Changes
Perform an action on a bucket which has an event configuration using the updated Kafka service endpoint and check the Kafka service for the notification data. The action required depends on which events were specified when configuring the bucket notification.
For example, if the bucket notification configuration includes the s3:ObjectCreated:Put event, you can use the mc cp command to create a new object in the bucket and trigger a notification.
8 - Publish Events to MySQL
MinIO supports publishing bucket notification events to a MySQL service endpoint. MinIO supports MySQL 5.7.8 and later only.
Add a MySQL Endpoint to a MinIO Deployment
The following procedure adds a new MySQL service endpoint for supporting bucket notifications in a MinIO deployment.
Prerequisites
MySQL 5.7.8 and later
MinIO relies on features introduced with MySQL 5.7.8.
MinIO mc Command Line Tool
This procedure uses the mc command line tool for certain actions. See the mc Quickstart for installation instructions.
1) Add the MySQL Endpoint to MinIO
You can configure a new MySQL service endpoint using either environment variables or by setting runtime configuration settings.
MinIO supports specifying the MySQL service endpoint and associated configuration settings using environment variables. The minio server process applies the specified settings on its next startup.
The following example code sets all environment variables related to configuring a MySQL service endpoint. The minimum required variables are:
MINIO_NOTIFY_MYSQL_ENABLEMINIO_NOTIFY_MYSQL_DSN_STRINGMINIO_NOTIFY_MYSQL_TABLEMINIO_NOTIFY_MYSQL_FORMAT
Windows
Linux and macOS
-
Replace
<IDENTIFIER>with a unique descriptive string for the MySQL service endpoint. Use the same<IDENTIFIER>value for all environment variables related to the new target service endpoint. The following examples assume an identifier ofPRIMARY.If the specified
<IDENTIFIER>matches an existing MySQL service endpoint on the MinIO deployment, the new settings override any existing settings for that endpoint. Usemc admin config get notify_mysqlto review the currently configured MySQL endpoints on the MinIO deployment. -
Replace
<ENDPOINT>with the DSN of the MySQL service endpoint. MinIO expects the following format:<user>:<password>@tcp(<host>:<port>)/<database>For example:
"username:password@tcp(mysql.example.com:3306)/miniodb"
See MySQL Service for Bucket Notifications for complete documentation on each environment variable.
MinIO supports adding or updating MySQL endpoints on a running minio server process using the mc admin config set command and the notify_mysql configuration key. You must restart the minio server process to apply any new or updated configuration settings.
The following example code sets all settings related to configuring an MySQL service endpoint. The minimum required settings are:
-
Replace
IDENTIFIERwith a unique descriptive string for the MySQL service endpoint. The following examples in this procedure assume an identifier ofPRIMARY.If the specified
IDENTIFIERmatches an existing MySQL service endpoint on the MinIO deployment, the new settings override any existing settings for that endpoint. Usemc admin config get notify_mysqlto review the currently configured MySQL endpoints on the MinIO deployment. -
Replace
<ENDPOINT>with the DSN of the MySQL service endpoint. MinIO expects the following format:<user>:<password>@tcp(<host>:<port>)/<database>For example:
"username:password@tcp(mysql.example.com:3306)/miniodb"
See MySQL Bucket Notification Configuration Settings for complete documentation on each setting.
1) Restart the MinIO Deployment
You must restart the MinIO deployment to apply the configuration changes. Use the mc admin service restart command to restart the deployment.
Replace ALIAS with the alias of the deployment to restart.
The minio server process prints a line on startup for each configured MySQL target similar to the following:
You must specify the ARN resource when configuring bucket notifications with the associated MySQL deployment as a target.
Identifying the ARN for your bucket notifications
You defined the <IDENTIFIER> to assign to the target ARN for your bucket notifications when creating the endpoint previously. The steps below return the ARNs configured on the deployment. Identify the ARN created previously by looking for the <IDENTIFIER> you specified.
Review the JSON output
-
Copy and run the following command, replacing
ALIASwith the alias of the deployment. -
In the JSON output, look for the key
info.sqsARN.The ARN you need is the value of that key that matches the
<IDENTIFIER>you specified.For example,
arn:minio:sqs::primary:mysql.
Use jq to parse the JSON for the value
-
Copy and run the following command, replacing
ALIASwith the alias of the deployment.This returns the ARN to use for notifications, such as
arn:minio:sqs::primary:mysql
3) Configure Bucket Notifications using the MySQL Endpoint as a Target
Use the mc event add command to add a new bucket notification event with the configured MySQL service as a target:
- Replace
ALIASwith the alias of a MinIO deployment. - Replace
BUCKETwith the name of the bucket in which to configure the event. - Replace
EVENTSwith a comma-separated list of events for which MinIO triggers notifications.
Use mc event ls to view all configured bucket events for a given notification target:
4) Validate the Configured Events
Perform an action on the bucket for which you configured the new event and check the MySQL service for the notification data. The action required depends on which events were specified when configuring the bucket notification.
For example, if the bucket notification configuration includes the s3:ObjectCreated:Put event, you can use the mc cp command to create a new object in the bucket and trigger a notification.
Update a MySQL Endpoint in a MinIO Deployment
The following procedure updates an existing MySQL service endpoint for supporting bucket notifications in a MinIO deployment.
Prerequisites
MySQL 5.7.8 and later
MinIO relies on features introduced with MySQL 5.7.8.
MinIO mc Command Line Tool
This procedure uses the mc command line tool for certain actions. See the mc Quickstart for installation instructions.
1) List Configured MySQL Endpoints In The Deployment
Use the mc admin config get command to list the currently configured MySQL service endpoints in the deployment:
Replace ALIAS with the alias of the MinIO deployment.
The command output resembles the following:
The notify_mysql key is the top-level configuration key for an MySQL Notification Settings. The dsn_string key specifies the MySQL service endpoint for the given notify_mysql key. The notify_mysql:<IDENTIFIER> suffix describes the unique identifier for that MySQL service endpoint.
Note the identifier for the MySQL service endpoint you want to update for the next step.
2) Update the MySQL Endpoint
Use the mc admin config set command to set the new configuration for the MySQL service endpoint:
The following configuration settings are the minimum required for a MySQL service endpoint:
All other configuration settings are optional. See MySQL Notification Settings for a complete list of MySQL configuration settings.
3) Restart the MinIO Deployment
You must restart the MinIO deployment to apply the configuration changes. Use the mc admin service restart command to restart the deployment.
Replace ALIAS with the alias of the deployment to restart.
The minio server process prints a line on startup for each configured MySQL target similar to the following:
4) Validate the Changes
Perform an action on a bucket which has an event configuration using the updated MySQL service endpoint and check the MySQL service for the notification data. The action required depends on which events were specified when configuring the bucket notification.
For example, if the bucket notification configuration includes the s3:ObjectCreated:Put event, you can use the mc cp command to create a new object in the bucket and trigger a notification.
9 - Publish Events to PostgreSQL
MinIO supports publishing bucket notification events to PostgreSQL. MinIO supports PostgreSQL 9.5 and later only.
Add a PostgreSQL Endpoint to a MinIO Deployment
The following procedure adds a new PostgreSQL service endpoint for supporting bucket notifications in a MinIO deployment.
Prerequisites
PostgreSQL 9.5 and later
MinIO relies on features introduced with PostgreSQL 9.5.
MinIO mc Command Line Tool
This procedure uses the mc command line tool for certain actions. See the mc Quickstart for installation instructions.
1) Add the PostgreSQL Endpoint to MinIO
You can configure a new PostgreSQL service endpoint using either environment variables or by setting runtime configuration settings.
MinIO supports specifying the PostgreSQL service endpoint and associated configuration settings using environment variables. The minio server process applies the specified settings on its next startup.
The following example code sets all environment variables related to configuring a PostgreSQL service endpoint. The minimum required variables are:
Windows
Linux and macOS
-
Replace
<IDENTIFIER>with a unique descriptive string for the PostgreSQL service endpoint. Use the same<IDENTIFIER>value for all environment variables related to the new target service endpoint. The following examples assume an identifier ofPRIMARY.If the specified
<IDENTIFIER>matches an existing PostgreSQL service endpoint on the MinIO deployment, the new settings override any existing settings for that endpoint. Usemc admin config get notify_postgresto review the currently configured PostgreSQL endpoints on the MinIO deployment. -
Replace
<ENDPOINT>with the PostgreSQL Connection String for PostgreSQL service endpoint. MinIO supportskey=valueformat for the connection string. For example:"host=https://postgresql.example.com port=5432 ..."For more complete documentation on supported PostgreSQL connection string parameters, see PostgreSQL Connection String.
See PostgreSQL Service for Bucket Notifications for complete documentation on each environment variable.
MinIO supports adding or updating PostgreSQL endpoints on a running minio server process using the mc admin config set command and the notify_postgres configuration key. You must restart the minio server process to apply any new or updated configuration settings.
The following example code sets all settings related to configuring an PostgreSQL service endpoint. The minimum required setting are:
-
Replace
IDENTIFIERwith a unique descriptive string for the PostgreSQL service endpoint. The following examples in this procedure assume an identifier ofPRIMARY.If the specified
IDENTIFIERmatches an existing PostgreSQL service endpoint on the MinIO deployment, the new settings override any existing settings for that endpoint. Usemc admin config get notify_postgresto review the currently configured PostgreSQL endpoints on the MinIO deployment. -
Replace
<ENDPOINT>with the PostgreSQL URI connection string of the PostgreSQL service endpoint. MinIO supportskey=valueformat 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 PostgreSQL Connection String.
See PostgreSQL Bucket Notification Configuration Settings for complete documentation on each setting.
1) Restart the MinIO Deployment
You must restart the MinIO deployment to apply the configuration changes. Use the mc admin service restart command to restart the deployment.
Replace ALIAS with the alias of the deployment to restart.
The minio server process prints a line on startup for each configured PostgreSQL target similar to the following:
You must specify the ARN resource when configuring bucket notifications with the associated PostgreSQL deployment as a target.
Identifying the ARN for your bucket notifications
You defined the <IDENTIFIER> to assign to the target ARN for your bucket notifications when creating the endpoint previously. The steps below return the ARNs configured on the deployment. Identify the ARN created previously by looking for the <IDENTIFIER> you specified.
Review the JSON output
-
Copy and run the following command, replacing
ALIASwith the alias of the deployment. -
In the JSON output, look for the key
info.sqsARN.The ARN you need is the value of that key that matches the
<IDENTIFIER>you specified.For example,
arn:minio:sqs::primary:postgresql.
Use jq to parse the JSON for the value
-
Copy and run the following command, replacing
ALIASwith the alias of the deployment.This returns the ARN to use for notifications, such as
arn:minio:sqs::primary:postgresql
3) Configure Bucket Notifications using the PostgreSQL Endpoint as a Target
Use the mc event add command to add a new bucket notification event with the configured PostgreSQL service as a target:
- Replace
ALIASwith the alias of a MinIO deployment. - Replace
BUCKETwith the name of the bucket in which to configure the ßevent. - Replace
EVENTSwith a comma-separated list of events for which MinIO triggers notifications.
Use mc event ls to view all configured bucket events for a given notification target:
4) Validate the Configured Events
Perform an action on the bucket for which you configured the new event and check the PostgreSQL service for the notification data. The action required depends on which events were specified when configuring the bucket notification.
For example, if the bucket notification configuration includes the s3:ObjectCreated:Put event, you can use the mc cp command to create a new object in the bucket and trigger a notification.
Update a PostgreSQL Endpoint in a MinIO Deployment
The following procedure updates an existing PostgreSQL service endpoint for supporting bucket notifications in a MinIO deployment.
Prerequisites
PostgreSQL 9.5 and later
MinIO relies on features introduced with PostgreSQL 9.5.
MinIO mc Command Line Tool
This procedure uses the mc command line tool for certain actions. See the mc Quickstart for installation instructions.
1) List Configured PostgreSQL Endpoints In The Deployment
Use the mc admin config get command to list the currently configured PostgreSQL service endpoints in the deployment:
Replace ALIAS with the alias of the MinIO deployment.
The command output resembles the following:
The notify_postgres key is the top-level configuration key for an PostgreSQL Notification Settings. The connection_string key specifies the PostgreSQL service endpoint for the given notify_postgres key. The notify_postgres:<IDENTIFIER> suffix describes the unique identifier for that PostgreSQL service endpoint.
Note the identifier for the PostgreSQL service endpoint you want to update for the next step.
2) Update the PostgreSQL Endpoint
Use the mc admin config set command to set the new configuration for the PostgreSQL service endpoint:
The following configuration settings are the minimum required for a PostgreSQL service endpoint:
All other configuration settings are optional. See PostgreSQL Notification Settings for a complete list of PostgreSQL configuration settings.
3) Restart the MinIO Deployment
You must restart the MinIO deployment to apply the configuration changes. Use the mc admin service restart command to restart the deployment.
Replace ALIAS with the alias of the deployment to restart.
The minio server process prints a line on startup for each configured PostgreSQL target similar to the following:
4) Validate the Changes
Perform an action on a bucket which has an event configuration using the updated PostgreSQL service endpoint and check the PostgreSQL service for the notification data. The action required depends on which events were specified when configuring the bucket notification.
For example, if the bucket notification configuration includes the s3:ObjectCreated:Put event, you can use the mc cp command to create a new object in the bucket and trigger a notification.
10 - Publish Events to Redis
MinIO supports publishing bucket notification events to a Redis service endpoint.
Add a Redis Endpoint to a MinIO Deployment
The following procedure adds a new Redis service endpoint for supporting bucket notifications in a MinIO deployment.
Prerequisites
MinIO mc Command Line Tool
This procedure uses the mc command line tool for certain actions. See the mc Quickstart for installation instructions.
1) Add the Redis Endpoint to MinIO
You can configure a new Redis service endpoint using either environment variables or by setting runtime configuration settings.
MinIO supports specifying the Redis service endpoint and associated configuration settings using environment variables. The minio server process applies the specified settings on its next startup.
The following example code sets all environment variables related to configuring an Redis service endpoint. The minimum required variables are:
MINIO_NOTIFY_REDIS_ENABLEMINIO_NOTIFY_REDIS_ADDRESSMINIO_NOTIFY_REDIS_KEYMINIO_NOTIFY_REDIS_FORMAT
Windows
Linux and macOS
-
Replace
<IDENTIFIER>with a unique descriptive string for the TARGET service endpoint. Use the same<IDENTIFIER>value for all environment variables related to the new target service endpoint. The following examples assume an identifier ofPRIMARY.If the specified
<IDENTIFIER>matches an existing Redis service endpoint on the MinIO deployment, the new settings override any existing settings for that endpoint. Usemc admin config get notify_redisto review the currently configured Redis endpoints on the MinIO deployment. -
Replace
<ENDPOINT>with the URL of the Redis service endpoint. For example:https://redis.example.com:6369
See Redis Service for Bucket Notifications for complete documentation on each environment variable.
MinIO supports adding or updating Redis endpoints on a running minio server process using the mc admin config set command and the notify_redis configuration key. You must restart the minio server process to apply any new or updated configuration settings.
The following example code sets all settings related to configuring an Redis service endpoint. The minimum required settings are:
-
Replace
IDENTIFIERwith a unique descriptive string for the Redis service endpoint. The following examples in this procedure assume an identifier ofPRIMARY.If the specified
IDENTIFIERmatches an existing Redis service endpoint on the MinIO deployment, the new settings override any existing settings for that endpoint. Usemc admin config get notify_redisto review the currently configured Redis endpoints on the MinIO deployment. -
Replace
ENDPOINTwith the URL of the Redis service endpoint. For example:https://redis.example.com:6369
See Redis Bucket Notification Configuration Settings for complete documentation on each setting.
1) Restart the MinIO Deployment
You must restart the MinIO deployment to apply the configuration changes. Use the mc admin service restart command to restart the deployment.
Replace ALIAS with the alias of the deployment to restart.
The minio server process prints a line on startup for each configured Redis target similar to the following:
You must specify the ARN resource when configuring bucket notifications with the associated Redis deployment as a target.
Identifying the ARN for your bucket notifications
You defined the <IDENTIFIER> to assign to the target ARN for your bucket notifications when creating the endpoint previously. The steps below return the ARNs configured on the deployment. Identify the ARN created previously by looking for the <IDENTIFIER> you specified.
Review the JSON output
-
Copy and run the following command, replacing
ALIASwith the alias of the deployment. -
In the JSON output, look for the key
info.sqsARN.The ARN you need is the value of that key that matches the
<IDENTIFIER>you specified.For example,
arn:minio:sqs::primary:redis.
Use jq to parse the JSON for the value
-
Copy and run the following command, replacing
ALIASwith the alias of the deployment.This returns the ARN to use for notifications, such as
arn:minio:sqs::primary:redis
3) Configure Bucket Notifications using the Redis Endpoint as a Target
Use the mc event add command to add a new bucket notification event with the configured Redis service as a target:
- Replace
ALIASwith the alias of a MinIO deployment. - Replace
BUCKETwith the name of the bucket in which to configure the event. - Replace
EVENTSwith a comma-separated list of events for which MinIO triggers notifications.
Use mc event ls to view all configured bucket events for a given notification target:
4) Validate the Configured Events
Perform an action on the bucket for which you configured the new event and check the Redis service for the notification data. The action required depends on which events were specified when configuring the bucket notification.
For example, if the bucket notification configuration includes the s3:ObjectCreated:Put event, you can use the mc cp command to create a new object in the bucket and trigger a notification.
Update an Redis Endpoint in a MinIO Deployment
The following procedure updates an existing Redis service endpoint for supporting bucket notifications in a MinIO deployment.
Prerequisites
MinIO mc Command Line Tool
This procedure uses the mc command line tool for certain actions. See the mc Quickstart for installation instructions.
1) List Configured Redis Endpoints In The Deployment
Use the mc admin config get command to list the currently configured Redis service endpoints in the deployment:
Replace ALIAS with the alias of the MinIO deployment.
The command output resembles the following:
The notify_redis key is the top-level configuration key for an Redis Notification Settings. The address key specifies the Redis service endpoint for the given notify_redis key. The notify_redis:<IDENTIFIER> suffix describes the unique identifier for that Redis service endpoint.
Note the identifier for the Redis service endpoint you want to update for the next step.
2) Update the Redis Endpoint
Use the mc admin config set command to set the new configuration for the Redis service endpoint:
The notify_redis address configuration setting is the minimum required for an Redis service endpoint. All other configuration settings are optional. See Redis Notification Settings for a complete list of Redis configuration settings.
3) Restart the MinIO Deployment
You must restart the MinIO deployment to apply the configuration changes. Use the mc admin service restart command to restart the deployment.
Replace ALIAS with the alias of the deployment to restart.
The minio server process prints a line on startup for each configured Redis target similar to the following:
4) Validate the Changes
Perform an action on a bucket which has an event configuration using the updated Redis service endpoint and check the Redis service for the notification data. The action required depends on which events were specified when configuring the bucket notification.
For example, if the bucket notification configuration includes the s3:ObjectCreated:Put event, you can use the mc cp command to create a new object in the bucket and trigger a notification.
11 - Publish Events to Webhook
MinIO supports publishing bucket notification events to a Webhook service endpoint.
Add a Webhook Endpoint to a MinIO Deployment
The following procedure adds a new Webhook service endpoint for supporting bucket notifications in a MinIO deployment.
Prerequisites
MinIO mc Command Line Tool
This procedure uses the mc command line tool for certain actions. See the mc Quickstart for installation instructions.
1) Add the Webhook Endpoint to MinIO
You can configure a new Webhook service endpoint using either environment variables or by setting runtime configuration settings.
MinIO supports specifying the Webhook service endpoint and associated configuration settings using environment variables. The minio server process applies the specified settings on its next startup.
The following example code sets all environment variables related to configuring an Webhook service endpoint. The minimum required variables are MINIO_NOTIFY_WEBHOOK_ENABLE and MINIO_NOTIFY_WEBHOOK_ENDPOINT:
Windows
Linux and macOS
-
Replace
<IDENTIFIER>with a unique descriptive string for the Webhook service endpoint. Use the same<IDENTIFIER>value for all environment variables related to the new target service endpoint. The following examples assume an identifier ofPRIMARY.If the specified
<IDENTIFIER>matches an existing Webhook service endpoint on the MinIO deployment, the new settings override any existing settings for that endpoint. Usemc admin config get notify_webhookto review the currently configured Webhook endpoints on the MinIO deployment. -
Replace
<ENDPOINT>with the URL of the Webhook service endpoint. For example:https://webhook.example.com
See Webhook Service for Bucket Notifications for complete documentation on each environment variable.
MinIO supports adding or updating Webhook endpoints on a running minio server process using the mc admin config set command and the notify_webhook configuration key. You must restart the minio server process to apply any new or updated configuration settings.
The following example code sets all settings related to configuring an Webhook service endpoint. The minimum required setting is notify_webhook endpoint:
-
Replace
IDENTIFIERwith a unique descriptive string for the Webhook service endpoint. The following examples in this procedure assume an identifier ofPRIMARY.If the specified
IDENTIFIERmatches an existing Webhook service endpoint on the MinIO deployment, the new settings override any existing settings for that endpoint. Usemc admin config get notify_webhookto review the currently configured Webhook endpoints on the MinIO deployment. -
Replace
ENDPOINTwith the URL of the Webhook service endpoint. For example:https://webhook.example.com
See Webhook Bucket Notification Configuration Settings for complete documentation on each setting.
1) Restart the MinIO Deployment
You must restart the MinIO deployment to apply the configuration changes. Use the mc admin service restart command to restart the deployment.
Replace ALIAS with the alias of the deployment to restart.
The minio server process prints a line on startup for each configured Webhook target similar to the following:
You must specify the ARN resource when configuring bucket notifications with the associated Webhook deployment as a target.
Identifying the ARN for your bucket notifications
You defined the <IDENTIFIER> to assign to the target ARN for your bucket notifications when creating the endpoint previously. The steps below return the ARNs configured on the deployment. Identify the ARN created previously by looking for the <IDENTIFIER> you specified.
Review the JSON output
-
Copy and run the following command, replacing
ALIASwith the alias of the deployment. -
In the JSON output, look for the key
info.sqsARN.The ARN you need is the value of that key that matches the
<IDENTIFIER>you specified.For example,
arn:minio:sqs::primary:webhook.
Use jq to parse the JSON for the value
-
Copy and run the following command, replacing
ALIASwith the alias of the deployment.This returns the ARN to use for notifications, such as
arn:minio:sqs::primary:webhook
3) Configure Bucket Notifications using the Webhook Endpoint as a Target
Use the mc event add command to add a new bucket notification event with the configured Webhook service as a target:
- Replace
ALIASwith the alias of a MinIO deployment. - Replace
BUCKETwith the name of the bucket in which to configure the event. - Replace
EVENTSwith a comma-separated list of events for which MinIO triggers notifications.
Use mc event ls to view all configured bucket events for a given notification target:
4) Validate the Configured Events
Perform an action on the bucket for which you configured the new event and check the Webhook service for the notification data. The action required depends on which events were specified when configuring the bucket notification.
For example, if the bucket notification configuration includes the s3:ObjectCreated:Put event, you can use the mc cp command to create a new object in the bucket and trigger a notification.
Update an Webhook Endpoint in a MinIO Deployment
The following procedure updates an existing Webhook service endpoint for supporting bucket notifications in a MinIO deployment.
Prerequisites
MinIO mc Command Line Tool
This procedure uses the mc command line tool for certain actions. See the mc Quickstart for installation instructions.
1) List Configured Webhook Endpoints In The Deployment
Use the mc admin config get command to list the currently configured Webhook service endpoints in the deployment:
Replace ALIAS with the alias of the MinIO deployment.
The command output resembles the following:
The notify_webhook key is the top-level configuration key for an Webhook Service Notification Settings. The endpoint key specifies the Webhook service endpoint for the given notify_webhook key. The notify_webhook:<IDENTIFIER> suffix describes the unique identifier for that Webhook service endpoint.
Note the identifier for the Webhook service endpoint you want to update for the next step.
2) Update the Webhook Endpoint
Use the mc admin config set command to set the new configuration for the Webhook service endpoint:
The notify_webhook endpoint configuration setting is the minimum required for an Webhook service endpoint. All other configuration settings are optional. See Webhook Service Notification Settings for a complete list of Webhook configuration settings.
3) Restart the MinIO Deployment
You must restart the MinIO deployment to apply the configuration changes. Use the mc admin service restart command to restart the deployment.
Replace ALIAS with the alias of the deployment to restart.
The minio server process prints a line on startup for each configured Webhook target similar to the following:
4) Validate the Changes
Perform an action on a bucket which has an event configuration using the updated Webhook service endpoint and check the Webhook service for the notification data. The action required depends on which events were specified when configuring the bucket notification.
For example, if the bucket notification configuration includes the s3:ObjectCreated:Put event, you can use the mc cp command to create a new object in the bucket and trigger a notification.