1
0
mirror of https://github.com/minio/docs.git synced 2025-06-04 08:42:23 +03:00

Bucket Notification Import

CR fixes

Fixups
This commit is contained in:
ravindk89 2021-02-12 13:58:20 -05:00 committed by Ravind Kumar
parent 0e54583047
commit f1574f14ae
24 changed files with 8298 additions and 1562 deletions

View File

@ -3,4 +3,5 @@ sphinx-copybutton == 0.2.12
git+https://github.com/ravindk89/sphinx-tabs
recommonmark == 0.6.0
sphinx-markdown-tables == 0.0.15
Sphinx-Substitution-Extensions == 2020.9.30.0
Sphinx-Substitution-Extensions == 2020.9.30.0
sphinx-togglebutton === 0.2.3

File diff suppressed because it is too large Load Diff

View File

@ -16,7 +16,7 @@ The following table lists MinIO features and their corresponding documentation:
* - Feature
- Description
* - :doc:`Bucket Notifications </concepts/bucket-notifications>`
* - :doc:`Bucket Notifications </monitoring/bucket-notifications/bucket-notifications>`
- MinIO Bucket Notifications allows you to automatically publish
notifications to one or more configured notification targets when
specific events occur in a bucket.
@ -38,6 +38,5 @@ The following table lists MinIO features and their corresponding documentation:
:titlesonly:
:hidden:
/concepts/bucket-notifications
/concepts/bucket-versioning
/concepts/erasure-coding

View File

@ -43,7 +43,8 @@ extensions = [
'recommonmark',
'sphinx_markdown_tables',
'sphinx-prompt',
'sphinx_substitution_extensions'
'sphinx_substitution_extensions',
'sphinx_togglebutton'
]
# -- External Links
@ -57,7 +58,7 @@ extlinks = {
'github' : ('https://github.com/%s',''),
'kube-api' : ('https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/%s',''),
'aws-docs' : ('https://docs.aws.amazon.com/%s',''),
's3-docs' : ('https://docs.aws.amazon.com/AmazonS3/latest/dev/%s',''),
's3-docs' : ('https://docs.aws.amazon.com/AmazonS3/latest/userguide/%s',''),
's3-api' : ('https://docs.aws.amazon.com/AmazonS3/latest/API/%s',''),
'iam-docs' : ('https://docs.aws.amazon.com/IAM/latest/UserGuide/%s',''),
'release' : ('https://github.com/minio/mc/releases/tag/%s',''),

View File

@ -0,0 +1,18 @@
.. Used in the following pages:
- /monitoring/bucket-notifications/publish-events-to-amqp.rst
.. start-restart-downtime
.. important::
This procedure *requires* restarting all :mc:`minio server` processes
associated to the deployment at the same time. There is typically a brief
period of time during which API operations are interrupted or may fail.
Applications using an S3-compatible SDK with built-in retry logic *or* which
implement manual retry logic typically experience no notable interruption in
services. For applications which cannot use retry-logic, consider scheduling
a maintenance period to minimize interruption of services while performing
this procedure.
.. end-restart-downtime

View File

@ -0,0 +1,986 @@
.. Descriptions for AMQP bucket notification configurations.
Used in the following files:
- /source/reference/minio-server/minio-server.rst
- /source/reference/minio-cli/minio-mc-admin/mc-admin-config.rst
.. start-minio-notify-amqp-enable
Specify ``on`` to enable publishing bucket notifications to an AMQP endpoint.
Defaults to ``off``.
.. end-minio-notify-amqp-enable
.. start-minio-notify-amqp-url
Specify the AMQP server endpoint to which MinIO publishes bucket events.
For example, ``amqp://myuser:mypassword@localhost:5672``.
.. end-minio-notify-amqp-url
.. start-minio-notify-amqp-exchange
Specify the name of the AMQP exchange to use.
.. end-minio-notify-amqp-exchange
.. start-minio-notify-amqp-exchange-type
Specify the type of the AMQP exchange.
.. end-minio-notify-amqp-exchange-type
.. start-minio-notify-amqp-routing-key
Specify the routing key for publishing events.
.. end-minio-notify-amqp-routing-key
.. start-minio-notify-amqp-mandatory
Specify ``off`` to ignore undelivered messages errors. Defaults to ``on``.
.. end-minio-notify-amqp-mandatory
.. start-minio-notify-amqp-durable
Specify ``on`` to persist the message queue across broker restarts. Defaults to
'off'.
.. end-minio-notify-amqp-durable
.. start-minio-notify-amqp-no-wait
Specify ``on`` to enable non-blocking message delivery. Defaults to 'off'.
.. end-minio-notify-amqp-no-wait
.. start-minio-notify-amqp-internal
Specify ``on`` to use the exchange only if it is bound to other exchanges. See
the RabbitMQ documentation on `Exchange to Exchange Bindings
<https://www.rabbitmq.com/e2e.html>`__ for more information on AMQP exchange
binding.
.. end-minio-notify-amqp-internal
.. start-minio-notify-amqp-auto-deleted
Specify ``on`` to automatically delete the message queue if there are no
consumers. Defaults to ``off``.
.. end-minio-notify-amqp-auto-deleted
.. start-minio-notify-amqp-delivery-mode
Specify ``1`` for set the delivery mode to non-persistent queue.
Specify ``2`` to set the delivery mode to persistent queue.
.. end-minio-notify-amqp-delivery-mode
.. start-minio-notify-amqp-queue-dir
Specify the directory path to enable MinIO's persistent event store for
undelivered messages, such as ``/home/events``.
MinIO stores undelivered events in the specified store while the AMQP
service is offline and replays the directory when connectivity resumes.
.. end-minio-notify-amqp-queue-dir
.. start-minio-notify-amqp-queue-limit
Specify the maximum limit for undelivered messages. Defaults to ``10000``.
.. end-minio-notify-amqp-queue-limit
.. start-minio-notify-amqp-comment
Specify a comment for the AMQP configuration.
.. end-minio-notify-amqp-comment
.. Descriptions for MQTT bucket notification configurations.
Used in the following files:
- /source/reference/minio-server/minio-server.rst
- /source/reference/minio-cli/minio-mc-admin/mc-admin-config.rst
.. start-minio-notify-mqtt-enable
Specify ``on`` to enable publishing bucket notifications to an MQTT endpoint.
Defaults to ``off``.
.. end-minio-notify-mqtt-enable
.. start-minio-notify-mqtt-broker
Specify the MQTT server/broker endpoint. MinIO supports TCP, TLS, or Websocket
connections to the server/broker URL. For example:
- ``tcp://mqtt.example.net:1883``
- ``tls://mqtt.example.net:1883``
- ``ws://mqtt.example.net:1883``
.. end-minio-notify-mqtt-broker
.. start-minio-notify-mqtt-topic
Specify the name of the MQTT topic to associate with events published by
MinIO to the MQTT endpoint.
.. end-minio-notify-mqtt-topic
.. start-minio-notify-mqtt-username
Specify the MQTT username with which MinIO authenticates to the MQTT
server/broker.
.. end-minio-notify-mqtt-username
.. start-minio-notify-mqtt-password
Specify the password for the MQTT username with which MinIO authenticates to the
MQTT server/broker.
.. end-minio-notify-mqtt-password
.. start-minio-notify-mqtt-qos
Specify the Quality of Service priority for the published events.
Defaults to ``0``.
.. end-minio-notify-mqtt-qos
.. start-minio-notify-mqtt-keep-alive-interval
Specify the keep-alive interval for the MQTT connections. MinIO
supports the following units of time measurement:
- ``s`` - seconds, "60s"
- ``m`` - minutes, "60m"
- ``h`` - hours, "24h"
- ``d`` - days, "7d"
.. end-minio-notify-mqtt-keep-alive-interval
.. start-minio-notify-mqtt-reconnect-interval
Specify the reconnect interval for the MQTT connections. MinIO
supports the following units of time measurement:
- ``s`` - seconds, "60s"
- ``m`` - minutes, "60m"
- ``h`` - hours, "24h"
- ``d`` - days, "7d"
.. end-minio-notify-mqtt-reconnect-interval
.. start-minio-notify-mqtt-queue-dir
Specify the directory path to enable MinIO's persistent event store for
undelivered messages, such as ``/home/events``.
MinIO stores undelivered events in the specified store while the MQTT
server/broker is offline and replays the directory when connectivity resumes.
.. end-minio-notify-mqtt-queue-dir
.. start-minio-notify-mqtt-queue-limit
Specify the maximum limit for undelivered messages. Defaults to ``10000``.
.. end-minio-notify-mqtt-queue-limit
.. start-minio-notify-mqtt-comment
Specify a comment to associate with the MQTT configuration.
.. end-minio-notify-mqtt-comment
.. Descriptions for Elasticsearch bucket notification configurations.
Used in the following files:
- /source/reference/minio-server/minio-server.rst
- /source/reference/minio-cli/minio-mc-admin/mc-admin-config.rst
- /source/monitoring/bucket-notifications/publish-events-to-elasticsearch.rst
.. start-minio-notify-elasticsearch-enable
Specify ``on`` to enable publishing bucket notifications to an Elasticsearch
service endpoint.
Defaults to ``off``.
.. end-minio-notify-elasticsearch-enable
.. start-minio-notify-elasticsearch-url
Specify the Elasticsearch service endpoint to which MinIO publishes bucket
events. For example, ``https://elasticsearch.example.com:9200``.
MinIO supports passing authentication information using as URL parameters
using the format ``PROTOCOL://USERNAME:PASSWORD@HOSTNAME:PORT``.
.. end-minio-notify-elasticsearch-url
.. start-minio-notify-elasticsearch-index
Specify the name of the Elasticsearch index in which to store or update
MinIO bucket events. Elasticsearch automatically creates the index if it
does not exist.
.. end-minio-notify-elasticsearch-index
.. start-minio-notify-elasticsearch-format
Specify the format of event data written to the Elasticsearch index. MinIO
supports the following values:
``namespace``
For each bucket event, the 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 index entry for that object. Similarly, deleting the object
also deletes the corresponding index entry.
``access``
For each bucket event, MinIO creates a JSON document with the event
details and appends it to the index with an Elasticsearch-generated
random ID. Additional updates to an object result in new index entries,
and existing entries remain unmodified.
.. end-minio-notify-elasticsearch-format
.. start-minio-notify-elasticsearch-username
The username for connecting to an Elasticsearch service endpoint which
enforces authentication.
.. end-minio-notify-elasticsearch-username
.. start-minio-notify-elasticsearch-password
The password for connecting to an Elasticsearch service endpoint which enforces
authentication.
.. end-minio-notify-elasticsearch-password
.. start-minio-notify-elasticsearch-queue-limit
Specify the maximum limit for undelivered messages. Defaults to ``10000``.
.. end-minio-notify-elasticsearch-queue-limit
.. start-minio-notify-elasticsearch-queue-dir
Specify the directory path to enable MinIO's persistent event store for
undelivered messages, such as ``/home/events``.
MinIO stores undelivered events in the specified store while the Elasticsearch
service is offline and replays the directory when connectivity resumes.
.. end-minio-notify-elasticsearch-queue-dir
.. start-minio-notify-elasticsearch-comment
Specify a comment to associate with the Elasticsearch configuration.
.. end-minio-notify-elasticsearch-comment
.. Descriptions for NSQ bucket notification configurations.
Used in the following files:
- /source/reference/minio-server/minio-server.rst
- /source/reference/minio-cli/minio-mc-admin/mc-admin-config.rst
- /source/monitoring/bucket-notifications/publish-events-to-nsq.rst
.. start-minio-notify-nsq-enable
Specify ``on`` to enable publishing bucket notifications to an NSQ endpoint.
.. end-minio-notify-nsq-enable
.. start-minio-notify-nsq-nsqd-address
Specify the NSQ server address. For example:
``https://nsq-endpoing.example.net:4150``
.. end-minio-notify-nsq-nsqd-address
.. start-minio-notify-nsq-topic
Specify the name of the NSQ topic MinIO uses when publishing events to the
broker.
.. end-minio-notify-nsq-topic
.. start-minio-notify-nsq-tls
Specify ``on`` to enable TLS connectivity to the NSQ service broker.
.. end-minio-notify-nsq-tls
.. start-minio-notify-nsq-tls-skip-verify
Enables or disables TLS verification of the NSQ service broker TLS certificates.
- Specify ``on`` to disable TLS verification (Default).
- Specify ``off`` to enable TLS verification.
.. end-minio-notify-nsq-tls-skip-verify
.. start-minio-notify-nsq-queue-dir
Specify the directory path to enable MinIO's persistent event store for
undelivered messages, such as ``/home/events``.
MinIO stores undelivered events in the specified store while the NSQ
server/broker is offline and replays the directory when connectivity resumes.
.. end-minio-notify-nsq-queue-dir
.. start-minio-notify-nsq-queue-limit
Specify the maximum limit for undelivered messages. Defaults to ``10000``.
.. end-minio-notify-nsq-queue-limit
.. start-minio-notify-nsq-comment
Specify a comment to associate with the NSQ configuration.
.. end-minio-notify-nsq-comment
.. Descriptions for Redis bucket notification configurations.
Used in the following files:
- /source/reference/minio-server/minio-server.rst
- /source/reference/minio-cli/minio-mc-admin/mc-admin-config.rst
- /source/monitoring/bucket-notifications/publish-events-to-redis.rst
.. start-minio-notify-redis-enable
Specify ``on`` to enable publishing bucket notifications to a Redis
service endpoint.
Defaults to ``off``.
.. end-minio-notify-redis-enable
.. start-minio-notify-redis-address
Specify the Redis service endpoint to which MinIO publishes bucket events.
For example, ``https://redis.example.com:6369``.
.. end-minio-notify-redis-address
.. start-minio-notify-redis-key
Specify the Redis key to use for storing and updating events. Redis
auto-creates the key if it does not exist.
.. end-minio-notify-redis-key
.. start-minio-notify-redis-format
Specify the format of event data written to the Redis service endpoint. MinIO
supports the following values:
``namespace``
For each bucket event, the 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 index entry for that object. Similarly, deleting the object
also deletes the corresponding index entry.
``access``
For each bucket event, MinIO creates a JSON document with the event
details and appends it to the key with a Redis-generated
random ID. Additional updates to an object result in new index entries,
and existing entries remain unmodified.
.. end-minio-notify-redis-format
.. start-minio-notify-redis-password
Specify the password for the Redis server.
.. end-minio-notify-redis-password
.. start-minio-notify-redis-queue-dir
Specify the directory path to enable MinIO's persistent event store for
undelivered messages, such as ``/home/events``.
MinIO stores undelivered events in the specified store while the Redis
server/broker is offline and replays the directory when connectivity resumes.
.. end-minio-notify-redis-queue-dir
.. start-minio-notify-redis-queue-limit
Specify the maximum limit for undelivered messages. Defaults to ``10000``.
.. end-minio-notify-redis-queue-limit
.. start-minio-notify-redis-comment
Specify a comment to associate with the Redis configuration.
.. end-minio-notify-redis-comment
.. Descriptions for NATS bucket notification configurations.
Used in the following files:
- /source/reference/minio-server/minio-server.rst
- /source/reference/minio-cli/minio-mc-admin/mc-admin-config.rst
- /source/monitoring/bucket-notifications/publish-events-to-nats.rst
.. start-minio-notify-nats-enable
Specify ``on`` to enable publishing bucket notifications to an NATS
service endpoint.
Defaults to ``off``.
.. end-minio-notify-nats-enable
.. start-minio-notify-nats-address
Specify the NATS service endpoint to which MinIO publishes bucket events.
For example, ``https://nats-endpoint.example.com:4222``.
.. end-minio-notify-nats-address
.. start-minio-notify-nats-subject
Specify the subscription to which MinIO associates events
published to the NATS endpoint.
.. end-minio-notify-nats-subject
.. start-minio-notify-nats-username
Specify the username for connecting to the NATS service endpoint.
.. end-minio-notify-nats-username
.. start-minio-notify-nats-password
Specify the passport for connecting to the NATS service endpoint.
.. end-minio-notify-nats-password
.. start-minio-notify-nats-token
Specify the token for connecting to the NATS service endpoint.
.. end-minio-notify-nats-token
.. start-minio-notify-nats-tls
Specify ``on`` to enable TLS connectivity to the NATS service endpoint.
.. end-minio-notify-nats-tls
.. start-minio-notify-nats-tls-skip-verify
Enables or disables TLS verification of the NATS service endpoint TLS
certificates.
- Specify ``on`` to disable TLS verification (Default).
- Specify ``off`` to enable TLS verification.
.. end-minio-notify-nats-tls-skip-verify
.. start-minio-notify-nats-ping-interval
Specify the duration interval for client pings to the NATS server.
MinIO supports the following time units:
- ``s`` - seconds, ``"60s"``
- ``m`` - minutes, ``"5m"``
- ``h`` - hours, ``"1h"``
- ``d`` - days, ``"1d"``
.. end-minio-notify-nats-ping-interval
.. start-minio-notify-nats-streaming
Specify ``on`` to enable streaming events to the NATS service endpoint.
.. end-minio-notify-nats-streaming
.. start-minio-notify-nats-streaming-async
Specify ``on`` to enable asynchronous publishing of events to the NATS service
endpoint.
.. end-minio-notify-nats-streaming-async
.. start-minio-notify-nats-streaming-max-pub-acks-in-flight
Specify the number of messages to publish without waiting for an ACK
response from the NATS service endpoint.
.. end-minio-notify-nats-streaming-max-pub-acks-in-flight
.. start-minio-notify-nats-streaming-cluster-id
Specify the unique ID for the NATS streaming cluster.
.. end-minio-notify-nats-streaming-cluster-id
.. start-minio-notify-nats-cert-authority
Specify the path to the Certificate Authority chain used to sign the
NATS service endpoint TLS certificates.
.. end-minio-notify-nats-cert-authority
.. start-minio-notify-nats-client-cert
Specify the path to the client certificate to use for performing
mTLS authentication to the NATS service endpoint.
.. end-minio-notify-nats-client-cert
.. start-minio-notify-nats-client-key
Specify the path to the client private key to use for performing mTLS
authentication to the NATS service endpoint.
.. end-minio-notify-nats-client-key
.. start-minio-notify-nats-queue-dir
Specify the directory path to enable MinIO's persistent event store for
undelivered messages, such as ``/home/events``.
MinIO stores undelivered events in the specified store while the NATS
server/broker is offline and replays the directory when connectivity resumes.
.. end-minio-notify-nats-queue-dir
.. start-minio-notify-nats-queue-limit
Specify the maximum limit for undelivered messages. Defaults to ``10000``.
.. end-minio-notify-nats-queue-limit
.. start-minio-notify-nats-comment
Specify a comment to associate with the NATS configuration.
.. end-minio-notify-nats-comment
.. Descriptions for postgresql bucket notification configurations.
Used in the following files:
- /source/reference/minio-server/minio-server.rst
- /source/reference/minio-cli/minio-mc-admin/mc-admin-config.rst
- /source/monitoring/bucket-notifications/publish-events-to-postgresql.rst
.. start-minio-notify-postgresql-enable
Specify ``on`` to enable publishing bucket notifications to a PostgreSQL
service endpoint.
Defaults to ``off``.
.. end-minio-notify-postgresql-enable
.. start-minio-notify-postgresql-connection-string
Specify the `URI connection string
<https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING>`__
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
<https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING>`__
.
.. end-minio-notify-postgresql-connection-string
.. start-minio-notify-postgresql-table
Specify the name of the PostgreSQL table to which MinIO publishes
event notifications.
.. end-minio-notify-postgresql-table
.. start-minio-notify-postgresql-format
Specify the format of event data written to the PostgreSQL service endpoint.
MinIO supports the following values:
``namespace``
For each bucket event, the 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.
.. end-minio-notify-postgresql-format
.. start-minio-notify-postgresql-max-open-connections
Specify the maximum number of open connections to the PostgreSQL database.
Defaults to ``2``.
.. end-minio-notify-postgresql-max-open-connections
.. start-minio-notify-postgresql-queue-dir
Specify the directory path to enable MinIO's persistent event store for
undelivered messages, such as ``/home/events``.
MinIO stores undelivered events in the specified store while the PostgreSQL
server/broker is offline and replays the directory when connectivity resumes.
.. end-minio-notify-postgresql-queue-dir
.. start-minio-notify-postgresql-queue-limit
Specify the maximum limit for undelivered messages. Defaults to ``10000``.
.. end-minio-notify-postgresql-queue-limit
.. start-minio-notify-postgresql-comment
Specify a comment to associate with the PostgreSQL configuration.
.. end-minio-notify-postgresql-comment
.. Descriptions for MySQL bucket notification configurations.
Used in the following files:
- /source/reference/minio-server/minio-server.rst
- /source/reference/minio-cli/minio-mc-admin/mc-admin-config.rst
- /source/monitoring/bucket-notifications/publish-events-to-mysql.rst
.. start-minio-notify-mysql-enable
Specify ``on`` to enable publishing bucket notifications to a MySQL
service endpoint.
Defaults to ``off``.
.. end-minio-notify-mysql-enable
.. start-minio-notify-mysql-dsn-string
Specify the data source name (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"``
.. end-minio-notify-mysql-dsn-string
.. start-minio-notify-mysql-connection-string
Specify the data source name (DSN) connection string for 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"``
.. end-minio-notify-mysql-connection-string
.. start-minio-notify-mysql-table
Specify the name of the MySQL table to which MinIO publishes event
notifications.
.. end-minio-notify-mysql-table
.. start-minio-notify-mysql-format
Specify the format of event data written to the MySQL service endpoint.
MinIO supports the following values:
``namespace``
For each bucket event, the 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 MySQL-generated
random ID. Additional updates to an object result in new index entries,
and existing entries remain unmodified.
.. end-minio-notify-mysql-format
.. start-minio-notify-mysql-max-open-connections
Specify the maximum number of open connections to the MySQL database.
Defaults to ``2``.
.. end-minio-notify-mysql-max-open-connections
.. start-minio-notify-mysql-queue-dir
Specify the directory path to enable MinIO's persistent event store for
undelivered messages, such as ``/home/events``.
MinIO stores undelivered events in the specified store while the MySQL
server/broker is offline and replays the directory when connectivity resumes.
.. end-minio-notify-mysql-queue-dir
.. start-minio-notify-mysql-queue-limit
Specify the maximum limit for undelivered messages. Defaults to ``10000``.
.. end-minio-notify-mysql-queue-limit
.. start-minio-notify-mysql-comment
Specify a comment to associate with the MySQL configuration.
.. end-minio-notify-mysql-comment
.. Descriptions for Kafka bucket notification configurations.
Used in the following files:
- /source/reference/minio-server/minio-server.rst
- /source/reference/minio-cli/minio-mc-admin/mc-admin-config.rst
- /source/monitoring/bucket-notifications/publish-events-to-kafka.rst
.. start-minio-notify-kafka-enable
Specify ``on`` to enable publishing bucket notifications to a Kafka
service endpoint.
Defaults to ``off``.
.. end-minio-notify-kafka-enable
.. start-minio-notify-kafka-brokers
Specify a comma-separated list of Kafka broker addresses. For example:
``"kafka1.example.com:2021,kafka2.example.com:2021"``
.. end-minio-notify-kafka-brokers
.. start-minio-notify-kafka-topic
Specify the name of the Kafka topic to which MinIO publishes
bucket events.
.. end-minio-notify-kafka-topic
.. start-minio-notify-kafka-sasl-username
Specify the username for performing SASL/PLAIN or SASL/SCRAM authentication
to the Kafka broker(s).
.. end-minio-notify-kafka-sasl-username
.. start-minio-notify-kafka-sasl-password
Specify the password for performing SASL/PLAIN or SASL/SCRAM authentication
to the Kafka broker(s).
.. end-minio-notify-kafka-sasl-password
.. start-minio-notify-kafka-sasl-mechanism
Specify the SASL mechanism to use for authenticating to the Kafka broker(s).
MinIO supports the following mechanisms:
- ``PLAIN`` (Default)
- ``SCRAM``
.. end-minio-notify-kafka-sasl-mechanism
.. start-minio-notify-kafka-tls-client-auth
Specify the client authentication policy of the Kafka broker(s). See
`ClientAuthType <https://golang.org/pkg/crypto/tls/#ClientAuthType>`__ for
more information on possible values for this field.
.. https://pkg.go.dev/crypto/tls#ClientAuthType ?
.. end-minio-notify-kafka-tls-client-auth
.. start-minio-notify-kafka-sasl
Specify ``on`` to enable SASL authentication.
.. end-minio-notify-kafka-sasl
.. start-minio-notify-kafka-tls
Specify ``on`` to enable TLS connectivity to the Kafka broker(s)
.. end-minio-notify-kafka-tls
.. start-minio-notify-kafka-tls-skip-verify
Enables or disables TLS verification of the NATS service endpoint TLS
certificates.
- Specify ``on`` to disable TLS verification (Default).
- Specify ``off`` to enable TLS verification.
.. end-minio-notify-kafka-tls-skip-verify
.. start-minio-notify-kafka-client-tls-cert
Specify the path to the client certificate to use for performing
mTLS authentication to the Kafka broker(s).
.. end-minio-notify-kafka-client-tls-cert
.. start-minio-notify-kafka-client-tls-key
Specify the path to the client private key to use for performing
mTLS authentication to the Kafka broker(s).
.. end-minio-notify-kafka-client-tls-key
.. start-minio-notify-kafka-version
Specify the version of the Kafka cluster to assume when performing operations
against that cluster. See the `sarama reference documentation
<https://github.com/shopify/sarama/blob/v1.20.1/config.go#L327>`__ for
more information on this field's behavior.
.. end-minio-notify-kafka-version
.. start-minio-notify-kafka-queue-dir
Specify the directory path to enable MinIO's persistent event store for
undelivered messages, such as ``/home/events``.
MinIO stores undelivered events in the specified store while the Kafka
server/broker is offline and replays the directory when connectivity resumes.
.. end-minio-notify-kafka-queue-dir
.. start-minio-notify-kafka-queue-limit
Specify the maximum limit for undelivered messages. Defaults to ``10000``.
.. end-minio-notify-kafka-queue-limit
.. start-minio-notify-kafka-comment
Specify a comment to associate with the Kafka configuration.
.. end-minio-notify-kafka-comment
.. Descriptions for Webhook bucket notification configurations.
Used in the following files:
- /source/reference/minio-server/minio-server.rst
- /source/reference/minio-cli/minio-mc-admin/mc-admin-config.rst
- /source/monitoring/bucket-notifications/publish-events-to-webhook.rst
.. start-minio-notify-webhook-enable
Specify ``on`` to enable publishing bucket notifications to a Webhook
service endpoint.
Defaults to ``off``.
.. end-minio-notify-webhook-enable
.. start-minio-notify-webhook-endpoint
Specify the URL for the webhook service.
.. end-minio-notify-webhook-endpoint
.. start-minio-notify-webhook-auth-token
Specify the opaque string or JWT authorization token to use for
authenticating to the webhook service.
.. end-minio-notify-webhook-auth-token
.. start-minio-notify-webhook-client-cert
Specify the path to the client certificate to use for performing
mTLS authentication to the webhook service.
.. end-minio-notify-webhook-client-cert
.. start-minio-notify-webhook-client-key
Specify the path to the client private key to use for performing
mTLS authentication to the webhook service.
.. end-minio-notify-webhook-client-key
.. start-minio-notify-webhook-queue-dir
Specify the directory path to enable MinIO's persistent event store for
undelivered messages, such as ``/home/events``.
MinIO stores undelivered events in the specified store while the webhook
service is offline and replays the directory when connectivity resumes.
.. end-minio-notify-webhook-queue-dir
.. start-minio-notify-webhook-queue-limit
Specify the maximum limit for undelivered messages. Defaults to ``10000``.
.. end-minio-notify-webhook-queue-limit
.. start-minio-notify-webhook-comment
Specify a comment to associate with the Webhook configuration.
.. end-minio-notify-webhook-comment

View File

@ -22,6 +22,8 @@ Users deploying onto a Kubernetes cluster should start with our
/concepts/feature-overview
/tutorials/minio-installation
/security/security-overview
/monitoring/monitoring-overview
/reference/minio-cli/minio-mc
/reference/minio-cli/minio-mc-admin
/reference/minio-server/minio-server
/reference/minio-server/minio-gateway

View File

@ -0,0 +1,167 @@
.. _minio-bucket-notifications:
====================
Bucket Notifications
====================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
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
:s3-docs:`Amazon S3 Event Notifications <NotificationHowTo.html>`.
MinIO bucket notifications are available *only* with
:mc:`minio server` deployments. MinIO :ref:`Gateway <minio-gateway>`
does *not* support bucket notifications.
Supported Notification Targets
------------------------------
MinIO supports publishing event notifications to the following targets:
.. list-table::
:header-rows: 1
:widths: 30 70
:width: 100%
* - Target
- Description
* - :guilabel:`AMQP` (RabbitMQ)
- Publish notifications to an AMQP service such as
`RabbitMQ <https://www.rabbitmq.com>`__.
See :ref:`minio-bucket-notifications-publish-amqp` for a tutorial.
* - :guilabel:`MQTT`
- Publish notifications to an `MQTT <https://www.mqtt.org/>`__
service.
See :ref:`minio-bucket-notifications-publish-mqtt` for a tutorial.
* - :guilabel:`NATS`
- Publish notifications to a `NATS <https://nats.io/>`__ service.
See :ref:`minio-bucket-notifications-publish-nats` for a tutorial.
* - :guilabel:`NSQ`
- Publish notifications to a `NSQ <https://nsq.io/>`__ service.
See :ref:`minio-bucket-notifications-publish-nsq` for a tutorial
* - :guilabel:`Elasticsearch`
- Publish notifications to a `Elasticsearch <https://www.elastic.co/>`__
service.
See :ref:`minio-bucket-notifications-publish-elasticsearch` for a
tutorial.
* - :guilabel:`Kafka`
- Publish notifications to a `Kafka <https://kafka.apache.org/>`__ service.
See :ref:`minio-bucket-notifications-publish-kafka` for a tutorial.
* - :guilabel:`MySQL`
- Publish notifications to a `MySQL <https://www.mysql.com/>`__ service.
See :ref:`minio-bucket-notifications-publish-mysql` for a tutorial.
* - :guilabel:`PostgreSQL`
- Publish notifications to a `PostgreSQL <https://www.postgresql.org/>`__
service.
See :ref:`minio-bucket-notifications-publish-postgresql` for a tutorial.
* - :guilabel:`Redis`
- Publish notifications to a `Redis <https://redis.io/>`__ service.
See :ref:`minio-bucket-notifications-publish-redis` for a tutorial.
* - :guilabel:`webhook`
- Publish notifications to a `Webhook
<https://en.wikipedia.org/wiki/Webhook>`__ service.
See :ref:`minio-bucket-notifications-publish-webhook` for a tutorial.
.. _minio-bucket-notifications-event-types:
Supported S3 Event Types
------------------------
MinIO bucket notifications are compatible with
:s3-docs:`Amazon S3 Event Notifications <NotificationHowTo.html>`. This
section lists all supported events.
Object Events
~~~~~~~~~~~~~
MinIO supports triggering notifications on the following S3 object events:
.. data:: s3:ObjectRemoved:DeleteMarkerCreated
.. data:: s3:ObjectRemoved:Delete
.. data:: s3:ObjectCreated:PutRetention
.. data:: s3:ObjectCreated:PutLegalHold
.. data:: s3:ObjectCreated:Put
.. data:: s3:ObjectCreated:Post
.. data:: s3:ObjectCreated:Copy
.. data:: s3:ObjectCreated:CompleteMultipartUpload
.. data:: s3:ObjectAccessed:Head
.. data:: s3:ObjectAccessed:GetRetention
.. data:: s3:ObjectAccessed:GetLegalHold
.. data:: s3:ObjectAccessed:Get
Replication Events
~~~~~~~~~~~~~~~~~~
MinIO supports triggering notifications on the following S3 replication
events:
.. data:: s3:Replication:OperationCompletedReplication
.. data:: s3:Replication:OperationFailedReplication
.. data:: s3:Replication:OperationMissedThreshold
.. data:: s3:Replication:OperationNotTracked
.. data:: s3:Replication:OperationReplicatedAfterThreshold
ILM Transition Events
~~~~~~~~~~~~~~~~~~~~~
MinIO supports triggering notifications on the following S3 ILM transition
events:
.. data:: s3:ObjectRestore:Post
.. data:: s3:ObjectRestore:Completed
Global Events
~~~~~~~~~~~~~
MinIO supports triggering notifications on the following global events.
You can only listen to these events through the :legacy:`ListenNotification
<golang-client-api-reference.html#ListenNotification>` API:
.. data:: s3:BucketCreated
.. data:: s3:BucketRemoved
.. todo
.. toctree::
:titlesonly:
:hidden:
/monitoring/bucket-notifications/publish-events-to-amqp
/monitoring/bucket-notifications/publish-events-to-mqtt
/monitoring/bucket-notifications/publish-events-to-nats
/monitoring/bucket-notifications/publish-events-to-nsq
/monitoring/bucket-notifications/publish-events-to-elasticsearch
/monitoring/bucket-notifications/publish-events-to-kafka
/monitoring/bucket-notifications/publish-events-to-mysql
/monitoring/bucket-notifications/publish-events-to-postgresql
/monitoring/bucket-notifications/publish-events-to-redis
/monitoring/bucket-notifications/publish-events-to-webhook

View File

@ -0,0 +1,382 @@
.. _minio-bucket-notifications-publish-amqp:
=================================
Publish Events to AMQP (RabbitMQ)
=================================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 1
MinIO supports publishing :ref:`bucket notification
<minio-bucket-notifications>` events to a `AMQP 0-9-1 <https://www.amqp.org/>`__
service endpoint such as `RabbitMQ <https://www.rabbitmq.com>`__.
MinIO relies on the :github:`streadway/amqp` project for AMQP connectivity. The
project is primarily tested against `RabbitMQ <https://www.rabbitmq.com/>`__
deployments, though other `AMQP 0-9-1-compatible <https://www.amqp.org/>`__
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
:ref:`bucket notifications <minio-bucket-notifications>` in a MinIO
deployment.
.. include:: /includes/common-admonitions.rst
:start-after: start-restart-downtime
:end-before: end-restart-downtime
Prerequisites
~~~~~~~~~~~~~~
AMQP 0-9-1 Service Endpoint
+++++++++++++++++++++++++++
MinIO relies on the :github:`streadway/amqp` project for AMQP connectivity. The
project is primarily tested against `RabbitMQ <https://www.rabbitmq.com/>`__
deployments, though other `AMQP 0-9-1-compatible <https://www.amqp.org/>`__
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:`mc` command line tool for certain actions.
See the ``mc`` :ref:`Quickstart <mc-install>` 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.
.. tabs::
.. tab:: Environment Variables
MinIO supports specifying the AMQP service endpoint and associated
configuration settings using
:ref:`environment variables
<minio-server-envvar-bucket-notification-amqp>`. The
:mc:`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
:envvar:`MINIO_NOTIFY_AMQP_ENABLE` and :envvar:`MINIO_NOTIFY_AMQP_URL`:
.. code-block:: shell
:class: copyable
set MINIO_NOTIFY_AMQP_ENABLE_<IDENTIFIER>="on"
set MINIO_NOTIFY_AMQP_URL_<IDENTIFIER>="<ENDPOINT>"
set MINIO_NOTIFY_AMQP_EXCHANGE_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_AMQP_EXCHANGE_TYPE_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_AMQP_ROUTING_KEY_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_AMQP_MANDATORY_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_AMQP_DURABLE_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_AMQP_NO_WAIT_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_AMQP_INTERNAL_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_AMQP_AUTO_DELETED_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_AMQP_DELIVERY_MODE_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_AMQP_QUEUE_DIR_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_AMQP_QUEUE_LIMIT_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_AMQP_COMMENT_<IDENTIFIER>="<string>"
- 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 of ``PRIMARY``.
If the specified ``<IDENTIFIER>`` matches an existing AMQP service
endpoint on the MinIO deployment, the new settings *override*
any existing settings for that endpoint. Use
:mc-cmd:`mc admin config get notify_amqp <mc admin config get>` to
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 :ref:`AMQP Service for Bucket Notifications
<minio-server-envvar-bucket-notification-amqp>` for complete documentation
on each environment variable.
.. tab:: Configuration Settings
MinIO supports adding or updating AMQP endpoints on a running
:mc:`minio server` process using the :mc-cmd:`mc admin config set` command
and the :mc-conf:`notify_amqp` configuration key. You must restart the
:mc:`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
:mc-conf:`notify_amqp url <notify_amqp.url>`:
.. code-block:: shell
:class: copyable
mc admin config set ALIAS/ notify_amqp:IDENTIFIER \
url="ENDPOINT" \
exchange="<string>" \
exchange_type="<string>" \
routing_key="<string>" \
mandatory="<string>" \
durable="<string>" \
no_wait="<string>" \
internal="<string>" \
auto_deleted="<string>" \
delivery_mode="<string>" \
queue_dir="<string>" \
queue_limit="<string>" \
comment="<string>"
- Replace ``IDENTIFIER`` with a unique descriptive string for the
AMQP service endpoint. The following examples in this procedure
assume an identifier of ``PRIMARY``.
If the specified ``IDENTIFIER`` matches an existing AMQP service
endpoint on the MinIO deployment, the new settings *override*
any existing settings for that endpoint. Use
:mc-cmd:`mc admin config get notify_amqp <mc admin config get>` to
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 :ref:`AMQP Bucket Notification Configuration Settings
<minio-server-config-bucket-notification-amqp>` for complete
documentation on each setting.
2) Restart the MinIO Deployment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You must restart the MinIO deployment to apply the configuration changes.
Use the :mc-cmd:`mc admin service restart` command to restart the deployment.
.. important::
MinIO restarts *all* :mc:`minio server` processes associated to the
deployment at the same time. Applications may experience a brief period of
downtime during the restart process.
Consider scheduling the restart during a maintenance period to minimize
interruption of services.
.. code-block:: shell
:class: copyable
mc admin service restart ALIAS
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the deployment to
restart.
The :mc:`minio server` process prints a line on startup for each configured AMQP
target similar to the following:
.. code-block:: shell
SQS ARNs: arn:minio:sqs::primary:amqp
You must specify the ARN resource when configuring bucket notifications with
the associated AMQP deployment as a target.
3) Configure Bucket Notifications using the AMQP Endpoint as a Target
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the :mc-cmd:`mc event add` command to add a new bucket notification
event with the configured AMQP service as a target:
.. code-block:: shell
:class: copyable
mc event add ALIAS/BUCKET arn:minio:sqs::primary:amqp \
--event EVENTS
- Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of a MinIO deployment.
- Replace ``BUCKET`` with the name of the bucket in which to configure the
event.
- Replace ``EVENTS`` with a comma-separated list of :ref:`events
<mc-event-supported-events>` for which MinIO triggers notifications.
Use :mc-cmd:`mc event list` to view all configured bucket events for
a given notification target:
.. code-block:: shell
:class: copyable
mc event list ALIAS/BUCKET arn:minio:sqs::primary:amqp
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 :mc-cmd:`events <mc-event-add-event>` 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-cmd:`mc cp` command to create a new object in the bucket and trigger
a notification.
.. code-block:: shell
:class: copyable
mc cp ~/data/new-object.txt ALIAS/BUCKET
Update an AMQP Endpoint in a MinIO Deployment
---------------------------------------------
The following procedure updates an existing AMQP service endpoint for supporting
:ref:`bucket notifications <minio-bucket-notifications>` in a MinIO
deployment.
.. include:: /includes/common-admonitions.rst
:start-after: start-restart-downtime
:end-before: end-restart-downtime
Prerequisites
~~~~~~~~~~~~~~
AMQP 0-9-1 Service Endpoint
+++++++++++++++++++++++++++
MinIO relies on the :github:`streadway/amqp` project for AMQP connectivity. The
project is primarily tested against `RabbitMQ <https://www.rabbitmq.com/>`__
deployments, though other `AMQP 0-9-1-compatible <https://www.amqp.org/>`__
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:`mc` command line tool for certain actions.
See the ``mc`` :ref:`Quickstart <mc-install>` for installation instructions.
1) List Configured AMQP Endpoints In The Deployment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the :mc-cmd:`mc admin config get` command to list the currently
configured AMQP service endpoints in the deployment:
.. code-block:: shell
:class: copyable
mc admin config get ALIAS/ notify_amqp
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the MinIO deployment.
The command output resembles the following:
.. code-block:: shell
notify_amqp:primary delivery_mode="0" exchange_type="" no_wait="off" queue_dir="" queue_limit="0" url="amqp://user:password@hostname:port" auto_deleted="off" durable="off" exchange="" internal="off" mandatory="off" routing_key=""
notify_amqp:secondary delivery_mode="0" exchange_type="" no_wait="off" queue_dir="" queue_limit="0" url="amqp://user:password@hostname:port" auto_deleted="off" durable="off" exchange="" internal="off" mandatory="off" routing_key=""
The :mc-conf:`notify_amqp` key is the top-level configuration key for an
:ref:`minio-server-config-bucket-notification-amqp`. The
:mc-conf:`url <notify_amqp.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-cmd:`mc admin config set` command to set the new configuration
for the AMQP service endpoint:
.. code-block:: shell
:class: copyable
mc admin config set ALIAS/ notify_amqp:<IDENTIFIER> \
url="amqp://user:password@hostname:port" \
exchange="<string>" \
exchange_type="<string>" \
routing_key="<string>" \
mandatory="<string>" \
durable="<string>" \
no_wait="<string>" \
internal="<string>" \
auto_deleted="<string>" \
delivery_mode="<string>" \
queue_dir="<string>" \
queue_limit="<string>" \
comment="<string>"
The :mc-conf:`notify_amqp url <notify_amqp.url>` configuration setting is the
*minimum* required for an AMQP service endpoint. All other configuration
settings are *optional*. See :ref:`minio-server-config-bucket-notification-amqp`
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-cmd:`mc admin service restart` command to restart the deployment.
.. important::
MinIO restarts *all* :mc:`minio server` processes associated to the
deployment at the same time. Applications may experience a brief period of
downtime during the restart process.
Consider scheduling the restart during a maintenance period to minimize
interruption of services.
.. code-block:: shell
:class: copyable
mc admin service restart ALIAS
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the deployment to
restart.
The :mc:`minio server` process prints a line on startup for each configured AMQP
target similar to the following:
.. code-block:: shell
SQS ARNs: arn:minio:sqs::primary:amqp
3) 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 :mc-cmd:`events <mc-event-add-event>` 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-cmd:`mc cp` command to create a new object in the bucket and trigger
a notification.
.. code-block:: shell
:class: copyable
mc cp ~/data/new-object.txt ALIAS/BUCKET

View File

@ -0,0 +1,363 @@
.. _minio-bucket-notifications-publish-elasticsearch:
===============================
Publish Events to Elasticsearch
===============================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 1
MinIO supports publishing :ref:`bucket notification
<minio-bucket-notifications>` events to an
`Elasticsearch <https://www.elastic.co/>`__ service endpoint.
MinIO relies on the :github:`olivere/elastic` v7 project for Elastic
connectivity. The ``elastic/v7`` library specifically targets Elasticsearch
v7.0 and is *not compatible with earlier Elasticsearch versions*.
Add a Elasticsearch Endpoint to a MinIO Deployment
--------------------------------------------------
The following procedure adds a new Elasticsearch service endpoint for supporting
:ref:`bucket notifications <minio-bucket-notifications>` in a MinIO
deployment.
.. include:: /includes/common-admonitions.rst
:start-after: start-restart-downtime
:end-before: end-restart-downtime
Prerequisites
~~~~~~~~~~~~~
Elasticsearch v7.0 and later
++++++++++++++++++++++++++++
MinIO relies on the :github:`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:`mc` command line tool for certain actions.
See the ``mc`` :ref:`Quickstart <mc-install>` 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.
.. tabs::
.. tab:: Environment Variables
MinIO supports specifying the Elasticsearch service endpoint and associated
configuration settings using
:ref:`environment variables
<minio-server-envvar-bucket-notification-elasticsearch>`. The
:mc:`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:
- :envvar:`MINIO_NOTIFY_ELASTICSEARCH_ENABLE`
- :envvar:`MINIO_NOTIFY_ELASTICSEARCH_URL`
- :envvar:`MINIO_NOTIFY_ELASTICSEARCH_INDEX`
- :envvar:`MINIO_NOTIFY_ELASTICSEARCH_FORMAT`
.. code-block:: shell
:class: copyable
set MINIO_NOTIFY_ELASTICSEARCH_ENABLE_<IDENTIFIER>="on"
set MINIO_NOTIFY_ELASTICSEARCH_URL_<IDENTIFIER>="<ENDPOINT>"
set MINIO_NOTIFY_ELASTICSEARCH_INDEX_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_ELASTICSEARCH_FORMAT_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_ELASTICSEARCH_USERNAME_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_ELASTICSEARCH_PASSWORD_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_ELASTICSEARCH_QUEUE_DIR_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_ELASTICSEARCH_QUEUE_LIMIT_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_ELASTICSEARCH_COMMENT_<IDENTIFIER>="<string>"
- 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 of ``PRIMARY``.
If the specified ``<IDENTIFIER>`` matches an existing Elasticsearch
service endpoint on the MinIO deployment, the new settings *override*
any existing settings for that endpoint. Use
:mc-cmd:`mc admin config get notify_elasticsearch <mc admin config get>`
to review the currently configured Elasticsearch endpoints on the MinIO
deployment.
- Replace ``<ENDPOINT>`` with the URL of the Elasticsearch service endpoint.
For example:
See :ref:`Elasticsearch Service for Bucket Notifications
<minio-server-envvar-bucket-notification-elasticsearch>` for complete
documentation on each environment variable.
.. tab:: Configuration Settings
MinIO supports adding or updating Elasticsearch endpoints on a running
:mc:`minio server` process using the :mc-cmd:`mc admin config set` command
and the :mc-conf:`notify_elasticsearch` configuration key. You must restart the
:mc:`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:
- :mc-conf:`url <notify_elasticsearch.url>`
- :mc-conf:`index <notify_elasticsearch.index>`
- :mc-conf:`format <notify_elasticsearch.format>`
.. code-block:: shell
:class: copyable
mc admin config set ALIAS/ notify_elasticsearch:IDENTIFIER \
url="ENDPOINT" \
index="<string>" \
format="<string>" \
username="<string>" \
password="<string>" \
queue_dir="<string>" \
queue_limit="<string>" \
comment="<string>"
- Replace ``IDENTIFIER`` with a unique descriptive string for the
Elasticsearch service endpoint. The following examples in this procedure
assume an identifier of ``PRIMARY``.
If the specified ``IDENTIFIER`` matches an existing Elasticsearch service
endpoint on the MinIO deployment, the new settings *override*
any existing settings for that endpoint. Use
:mc-cmd:`mc admin config get notify_elasticsearch <mc admin config get>`
to review the currently configured Elasticsearch endpoints on the MinIO
deployment.
- Replace ``ENDPOINT`` with the URL of the Elasticsearch service endpoint.
For example:
``https://user:password@hostname:port``
See :ref:`Elasticsearch Bucket Notification Configuration Settings
<minio-server-config-bucket-notification-elasticsearch>` for complete
documentation on each setting.
2) Restart the MinIO Deployment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You must restart the MinIO deployment to apply the configuration changes.
Use the :mc-cmd:`mc admin service restart` command to restart the deployment.
.. important::
MinIO restarts *all* :mc:`minio server` processes associated to the
deployment at the same time. Applications may experience a brief period of
downtime during the restart process.
Consider scheduling the restart during a maintenance period to minimize
interruption of services.
.. code-block:: shell
:class: copyable
mc admin service restart ALIAS
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the deployment to
restart.
The :mc:`minio server` process prints a line on startup for each configured Elasticsearch
target similar to the following:
.. code-block:: shell
SQS ARNs: arn:minio:sqs::primary:elasticsearch
You must specify the ARN resource when configuring bucket notifications with
the associated Elasticsearch deployment as a target.
3) Configure Bucket Notifications using the Elasticsearch Endpoint as a Target
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the :mc-cmd:`mc event add` command to add a new bucket notification
event with the configured Elasticsearch service as a target:
.. code-block:: shell
:class: copyable
mc event add ALIAS/BUCKET arn:minio:sqs::primary:elasticsearch \
--event EVENTS
- Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of a MinIO deployment.
- Replace ``BUCKET`` with the name of the bucket in which to configure the
event.
- Replace ``EVENTS`` with a comma-separated list of :ref:`events
<mc-event-supported-events>` for which MinIO triggers notifications.
Use :mc-cmd:`mc event list` to view all configured bucket events for
a given notification target:
.. code-block:: shell
:class: copyable
mc event list ALIAS/BUCKET arn:minio:sqs::primary:Elasticsearch
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 :mc-cmd:`events <mc-event-add-event>` 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-cmd:`mc cp` command to create a new object in the bucket and trigger
a notification.
.. code-block:: shell
:class: copyable
mc cp ~/data/new-object.txt ALIAS/BUCKET
Update an Elasticsearch Endpoint in a MinIO Deployment
------------------------------------------------------
The following procedure updates an existing Elasticsearch service endpoint for supporting
:ref:`bucket notifications <minio-bucket-notifications>` in a MinIO
deployment.
.. include:: /includes/common-admonitions.rst
:start-after: start-restart-downtime
:end-before: end-restart-downtime
Prerequisites
~~~~~~~~~~~~~~
Elasticsearch v7.0 and later
++++++++++++++++++++++++++++
MinIO relies on the :github:`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:`mc` command line tool for certain actions.
See the ``mc`` :ref:`Quickstart <mc-install>` for installation instructions.
1) List Configured Elasticsearch Endpoints In The Deployment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the :mc-cmd:`mc admin config get` command to list the currently
configured Elasticsearch service endpoints in the deployment:
.. code-block:: shell
:class: copyable
mc admin config get ALIAS/ notify_elasticsearch
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the MinIO deployment.
The command output resembles the following:
.. code-block:: shell
notify_elasticsearch:primary queue_dir="" queue_limit="0" url="https://user:password@hostname:port" format="namespace" index=""
notify_elasticsearch:secondary queue_dir="" queue_limit="0" url="https://user:password@hostname:port" format="namespace" index=""
The :mc-conf:`notify_elasticsearch` key is the top-level configuration key for
an :ref:`minio-server-config-bucket-notification-elasticsearch`. The
:mc-conf:`url <notify_elasticsearch.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-cmd:`mc admin config set` command to set the new configuration
for the Elasticsearch service endpoint:
.. code-block:: shell
:class: copyable
mc admin config set ALIAS/ notify_elasticsearch:<IDENTIFIER> \
url="https://user:password@hostname:port" \
index="<string>" \
format="<string>" \
username="<string>" \
password="<string>" \
queue_dir="<string>" \
queue_limit="<string>" \
comment="<string>"
The :mc-conf:`notify_elasticsearch url <notify_elasticsearch.url>` configuration
setting is the *minimum* required for an Elasticsearch service endpoint. All
other configuration settings are *optional*. See
:ref:`minio-server-config-bucket-notification-elasticsearch` 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-cmd:`mc admin service restart` command to restart the deployment.
.. important::
MinIO restarts *all* :mc:`minio server` processes associated to the
deployment at the same time. Applications may experience a brief period of
downtime during the restart process.
Consider scheduling the restart during a maintenance period to minimize
interruption of services.
.. code-block:: shell
:class: copyable
mc admin service restart ALIAS
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the deployment to
restart.
The :mc:`minio server` process prints a line on startup for each configured
Elasticsearch target similar to the following:
.. code-block:: shell
SQS ARNs: arn:minio:sqs::primary:elasticsearch
3) 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
:mc-cmd:`events <mc-event-add-event>` 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-cmd:`mc cp` command to create a new object in the bucket and trigger
a notification.
.. code-block:: shell
:class: copyable
mc cp ~/data/new-object.txt ALIAS/BUCKET

View File

@ -0,0 +1,375 @@
.. _minio-bucket-notifications-publish-kafka:
=======================
Publish Events to Kafka
=======================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 1
MinIO supports publishing :ref:`bucket notification
<minio-bucket-notifications>` events to a `Kafka <https://kafka.apache.org/>`__
service endpoint.
MinIO relies on the :github:`Shopify/sarama` project for Kafka connectivity
and shares that project's Kafka support. See the
``sarama`` :github:`Compatibility and API stability
<Shopify/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
:ref:`bucket notifications <minio-bucket-notifications>` in a MinIO
deployment.
.. include:: /includes/common-admonitions.rst
:start-after: start-restart-downtime
:end-before: end-restart-downtime
Prerequisites
~~~~~~~~~~~~~
Kafka Minimum Versions and Supported Versions
+++++++++++++++++++++++++++++++++++++++++++++
MinIO relies on the :github:`Shopify/sarama` project for Kafka connectivity
and shares that project's Kafka support. See the
``sarama`` :github:`Compatibility and API stability
<Shopify/sarama/#compatibility-and-api-stability>` section for more details.
MinIO ``mc`` Command Line Tool
++++++++++++++++++++++++++++++
This procedure uses the :mc:`mc` command line tool for certain actions.
See the ``mc`` :ref:`Quickstart <mc-install>` 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.
.. tabs::
.. tab:: Environment Variables
MinIO supports specifying the Kafka service endpoint and associated
configuration settings using
:ref:`environment variables
<minio-server-envvar-bucket-notification-kafka>`. The
:mc:`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
:envvar:`MINIO_NOTIFY_KAFKA_ENABLE` and
:envvar:`MINIO_NOTIFY_KAFKA_BROKERS`:
.. code-block:: shell
:class: copyable
set MINIO_NOTIFY_KAFKA_ENABLE_<IDENTIFIER>="on"
set MINIO_NOTIFY_KAFKA_BROKERS_<IDENTIFIER>="<ENDPOINT>"
set MINIO_NOTIFY_KAFKA_TOPIC_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_KAFKA_SASL_USERNAME_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_KAFKA_SASL_PASSWORD_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_KAFKA_SASL_MECHANISM_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_KAFKA_TLS_CLIENT_AUTH_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_KAFKA_SASL_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_KAFKA_TLS_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_KAFKA_TLS_SKIP_VERIFY_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_KAFKA_CLIENT_TLS_CERT_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_KAFKA_CLIENT_TLS_KEY_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_KAFKA_QUEUE_DIR_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_KAFKA_QUEUE_LIMIT_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_KAFKA_VERSION_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_KAFKA_COMMENT_<IDENTIFIER>="<string>"
- 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 of ``PRIMARY``.
If the specified ``<IDENTIFIER>`` matches an existing Kafka service
endpoint on the MinIO deployment, the new settings *override*
any existing settings for that endpoint. Use
:mc-cmd:`mc admin config get notify_kafka <mc admin config get>` to
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 :ref:`Kafka Service for Bucket Notifications
<minio-server-envvar-bucket-notification-kafka>` for complete documentation
on each environment variable.
.. tab:: Configuration Settings
MinIO supports adding or updating Kafka endpoints on a running
:mc:`minio server` process using the :mc-cmd:`mc admin config set` command
and the :mc-conf:`notify_kafka` configuration key. You must restart the
:mc:`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
:mc-conf:`notify_kafka brokers <notify_kafka.brokers>`:
.. code-block:: shell
:class: copyable
mc admin config set ALIAS/ notify_kafka:IDENTIFIER \
brokers="<ENDPOINT>" \
topic="<string>" \
sasl_username="<string>" \
sasl_password="<string>" \
sasl_mechanism="<string>" \
tls_client_auth="<string>" \
sasl="<string>" \
tls="<string>" \
tls_skip_verify="<string>" \
client_tls_cert="<string>" \
client_tls_key="<string>" \
version="<string>" \
queue_dir="<string>" \
queue_limit="<string>" \
comment="<string>"
- Replace ``IDENTIFIER`` with a unique descriptive string for the
Kafka service endpoint. The following examples in this procedure
assume an identifier of ``PRIMARY``.
If the specified ``IDENTIFIER`` matches an existing Kafka service
endpoint on the MinIO deployment, the new settings *override*
any existing settings for that endpoint. Use
:mc-cmd:`mc admin config get notify_kafka <mc admin config get>` to
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 :ref:`Kafka Bucket Notification Configuration Settings
<minio-server-config-bucket-notification-kafka>` for complete
documentation on each setting.
2) Restart the MinIO Deployment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You must restart the MinIO deployment to apply the configuration changes.
Use the :mc-cmd:`mc admin service restart` command to restart the deployment.
.. important::
MinIO restarts *all* :mc:`minio server` processes associated to the
deployment at the same time. Applications may experience a brief period of
downtime during the restart process.
Consider scheduling the restart during a maintenance period to minimize
interruption of services.
.. code-block:: shell
:class: copyable
mc admin service restart ALIAS
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the deployment to
restart.
The :mc:`minio server` process prints a line on startup for each configured
Kafka target similar to the following:
.. code-block:: shell
SQS ARNs: arn:minio:sqs::primary:kafka
You must specify the ARN resource when configuring bucket notifications with
the associated Kafka deployment as a target.
3) Configure Bucket Notifications using the Kafka Endpoint as a Target
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the :mc-cmd:`mc event add` command to add a new bucket notification
event with the configured Kafka service as a target:
.. code-block:: shell
:class: copyable
mc event add ALIAS/BUCKET arn:minio:sqs::primary:kafka \
--event EVENTS
- Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of a MinIO deployment.
- Replace ``BUCKET`` with the name of the bucket in which to configure the
event.
- Replace ``EVENTS`` with a comma-separated list of :ref:`events
<mc-event-supported-events>` for which MinIO triggers notifications.
Use :mc-cmd:`mc event list` to view all configured bucket events for
a given notification target:
.. code-block:: shell
:class: copyable
mc event list ALIAS/BUCKET arn:minio:sqs::primary:kafka
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 :mc-cmd:`events <mc-event-add-event>` 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-cmd:`mc cp` command to create a new object in the bucket and trigger
a notification.
.. code-block:: shell
:class: copyable
mc cp ~/data/new-object.txt ALIAS/BUCKET
Update a Kafka Endpoint in a MinIO Deployment
---------------------------------------------
The following procedure updates an existing Kafka service endpoint for supporting
:ref:`bucket notifications <minio-bucket-notifications>` in a MinIO
deployment.
.. include:: /includes/common-admonitions.rst
:start-after: start-restart-downtime
:end-before: end-restart-downtime
Prerequisites
~~~~~~~~~~~~~~
Kafka Minimum Versions and Supported Versions
+++++++++++++++++++++++++++++++++++++++++++++
MinIO relies on the :github:`Shopify/sarama` project for Kafka connectivity
and shares that project's Kafka support. See the
``sarama`` :github:`Compatibility and API stability
<Shopify/sarama/#compatibility-and-api-stability>` section for more details.
MinIO ``mc`` Command Line Tool
++++++++++++++++++++++++++++++
This procedure uses the :mc:`mc` command line tool for certain actions.
See the ``mc`` :ref:`Quickstart <mc-install>` for installation instructions.
1) List Configured Kafka Endpoints In The Deployment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the :mc-cmd:`mc admin config get` command to list the currently
configured Kafka service endpoints in the deployment:
.. code-block:: shell
:class: copyable
mc admin config get ALIAS/ notify_kafka
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the MinIO deployment.
The command output resembles the following:
.. code-block:: shell
notify_kafka:primary tls_skip_verify="off" queue_dir="" queue_limit="0" sasl="off" sasl_password="" sasl_username="" tls_client_auth="0" tls="off" brokers="" topic="" client_tls_cert="" client_tls_key="" version=""
notify_kafka:secondary tls_skip_verify="off" queue_dir="" queue_limit="0" sasl="off" sasl_password="" sasl_username="" tls_client_auth="0" tls="off" brokers="" topic="" client_tls_cert="" client_tls_key="" version=""
The :mc-conf:`notify_kafka` key is the top-level configuration key for an
:ref:`minio-server-config-bucket-notification-kafka`. The
:mc-conf:`brokers <notify_kafka.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-cmd:`mc admin config set` command to set the new configuration
for the Kafka service endpoint:
.. code-block:: shell
:class: copyable
mc admin config set ALIAS/ notify_kafka:<IDENTIFIER> \
url="https://kafka1.example.net:9200, https://kafka2.example.net:9200" \
exchange="<string>" \
exchange_type="<string>" \
routing_key="<string>" \
mandatory="<string>" \
durable="<string>" \
no_wait="<string>" \
internal="<string>" \
auto_deleted="<string>" \
delivery_mode="<string>" \
queue_dir="<string>" \
queue_limit="<string>" \
comment="<string>"
The :mc-conf:`notify_kafka brokers <notify_kafka.brokers>` configuration setting
is the *minimum* required for a Kafka service endpoint. All other configuration
settings are *optional*. See
:ref:`minio-server-config-bucket-notification-kafka` 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-cmd:`mc admin service restart` command to restart the deployment.
.. important::
MinIO restarts *all* :mc:`minio server` processes associated to the
deployment at the same time. Applications may experience a brief period of
downtime during the restart process.
Consider scheduling the restart during a maintenance period to minimize
interruption of services.
.. code-block:: shell
:class: copyable
mc admin service restart ALIAS
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the deployment to
restart.
The :mc:`minio server` process prints a line on startup for each configured
Kafka target similar to the following:
.. code-block:: shell
SQS ARNs: arn:minio:sqs::primary:kafka
3) 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 :mc-cmd:`events <mc-event-add-event>` 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-cmd:`mc cp` command to create a new object in the bucket and trigger
a notification.
.. code-block:: shell
:class: copyable
mc cp ~/data/new-object.txt ALIAS/BUCKET

View File

@ -0,0 +1,389 @@
.. _minio-bucket-notifications-publish-mqtt:
======================
Publish Events to MQTT
======================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 1
MinIO supports publishing :ref:`bucket notification
<minio-bucket-notifications>` events to `MQTT <https://www.mqtt.org/>`__
server/broker endpoint.
Add an MQTT Endpoint to a MinIO Deployment
------------------------------------------
The following procedure adds a new MQTT service endpoint for supporting
:ref:`bucket notifications <minio-bucket-notifications>` in a MinIO
deployment.
.. include:: /includes/common-admonitions.rst
:start-after: start-restart-downtime
:end-before: end-restart-downtime
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 <https://mqtt.org/software/>`__ 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:`mc` command line tool for certain actions.
See the ``mc`` :ref:`Quickstart <mc-install>` 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.
.. tabs::
.. tab:: Environment Variables
MinIO supports specifying the MQTT service endpoint and associated
configuration settings using
:ref:`environment variables
<minio-server-envvar-bucket-notification-mqtt>`. The
:mc:`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:
- :envvar:`MINIO_NOTIFY_MQTT_ENABLE`
- :envvar:`MINIO_NOTIFY_MQTT_BROKER`
- :envvar:`MINIO_NOTIFY_MQTT_TOPIC`
- :envvar:`MINIO_NOTIFY_MQTT_USERNAME` *Required if the MQTT server/broker enforces authentication/authorization*
- :envvar:`MINIO_NOTIFY_MQTT_PASSWORD` *Required if the MQTT server/broker enforces authentication/authorization*
.. code-block:: shell
:class: copyable
set MINIO_NOTIFY_MQTT_ENABLE_<IDENTIFIER>="on"
set MINIO_NOTIFY_MQTT_BROKER_<IDENTIFIER>="ENDPOINT"
set MINIO_NOTIFY_MQTT_TOPIC_<IDENTIFIER>="TOPIC"
set MINIO_NOTIFY_MQTT_USERNAME_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_MQTT_PASSWORD_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_MQTT_QOS_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_MQTT_KEEP_ALIVE_INTERVAL_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_MQTT_RECONNECT_INTERVAL_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_MQTT_QUEUE_DIR_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_MQTT_QUEUE_LIMIT_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_MQTT_COMMENT_<IDENTIFIER>="<string>"
- 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 of ``PRIMARY``.
If the specified ``<IDENTIFIER>`` matches an existing MQTT service
endpoint on the MinIO deployment, the new settings *override*
any existing settings for that endpoint. Use
:mc-cmd:`mc admin config get notify_mqtt <mc admin config get>` to
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 ``TOPIC`` with the MQTT topic to which MinIO associates
events published to the server/broker.
See :ref:`MQTT Service for Bucket Notifications
<minio-server-envvar-bucket-notification-mqtt>` for complete documentation
on each environment variable.
.. tab:: Configuration Settings
MinIO supports adding or updating MQTT endpoints on a running
:mc:`minio server` process using the :mc-cmd:`mc admin config set` command
and the :mc-conf:`notify_mqtt` configuration key. You must restart the
:mc:`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:
- :mc-conf:`~notify_mqtt.broker`
- :mc-conf:`~notify_mqtt.topic`
- :mc-conf:`~notify_mqtt.username` *Required if the MQTT server/broker enforces authentication/authorization*
- :mc-conf:`~notify_mqtt.password` *Required if the MQTT server/broker enforces authentication/authorization*
.. code-block:: shell
:class: copyable
mc admin config set ALIAS/ notify_mqtt:IDENTIFIER \
broker="ENDPOINT" \
topic="TOPIC" \
username="username" \
password="password" \
qos="<integer>" \
keep_alive_interval="60s|m|h|d"
reconnect_interval="60s|m|h|d"
queue_dir="<string>" \
queue_limit="<string>" \
comment="<string>"
- Replace ``IDENTIFIER`` with a unique descriptive string for the
MQTT service endpoint. The following examples in this procedure
assume an identifier of ``PRIMARY``.
If the specified ``IDENTIFIER`` matches an existing MQTT service
endpoint on the MinIO deployment, the new settings *override*
any existing settings for that endpoint. Use
:mc-cmd:`mc admin config get notify_mqtt <mc admin config get>` to
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 ``TOPIC`` with the MQTT topic to which MinIO associates
events published to the server/broker.
See :ref:`MQTT Bucket Notification Configuration Settings
<minio-server-config-bucket-notification-mqtt>` for complete
documentation on each setting.
2) Restart the MinIO Deployment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You must restart the MinIO deployment to apply the configuration changes.
Use the :mc-cmd:`mc admin service restart` command to restart the deployment.
.. important::
MinIO restarts *all* :mc:`minio server` processes associated to the
deployment at the same time. Applications may experience a brief period of
downtime during the restart process.
Consider scheduling the restart during a maintenance period to minimize
interruption of services.
.. code-block:: shell
:class: copyable
mc admin service restart ALIAS
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the deployment to
restart.
The :mc:`minio server` process prints a line on startup for each configured MQTT
target similar to the following:
.. code-block:: shell
SQS ARNs: arn:minio:sqs::primary:mqtt
You must specify the ARN resource when configuring bucket notifications with
the associated MQTT deployment as a target.
3) Configure Bucket Notifications using the MQTT Endpoint as a Target
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the :mc-cmd:`mc event add` command to add a new bucket notification
event with the configured MQTT service as a target:
.. code-block:: shell
:class: copyable
mc event add ALIAS/BUCKET arn:minio:sqs::primary:mqtt \
--event EVENTS
- Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of a MinIO deployment.
- Replace ``BUCKET`` with the name of the bucket in which to configure the
event.
- Replace ``EVENTS`` with a comma-separated list of :ref:`events
<mc-event-supported-events>` for which MinIO triggers notifications.
Use :mc-cmd:`mc event list` to view all configured bucket events for
a given notification target:
.. code-block:: shell
:class: copyable
mc event list ALIAS/BUCKET arn:minio:sqs::primary:MQTT
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 :mc-cmd:`events <mc-event-add-event>` 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-cmd:`mc cp` command to create a new object in the bucket and trigger
a notification.
.. code-block:: shell
:class: copyable
mc cp ~/data/new-object.txt ALIAS/BUCKET
Update an MQTT Endpoint in a MinIO Deployment
---------------------------------------------
The following procedure updates an existing MQTT service endpoint for supporting
:ref:`bucket notifications <minio-bucket-notifications>` in a MinIO
deployment.
.. include:: /includes/common-admonitions.rst
:start-after: start-restart-downtime
:end-before: end-restart-downtime
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 <https://mqtt.org/software/>`__ 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:`mc` command line tool for certain actions.
See the ``mc`` :ref:`Quickstart <mc-install>` for installation instructions.
1) List Configured MQTT Endpoints In The Deployment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the :mc-cmd:`mc admin config get` command to list the currently
configured MQTT service endpoints in the deployment:
.. code-block:: shell
:class: copyable
mc admin config get ALIAS/ notify_mqtt
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the MinIO deployment.
The command output resembles the following:
.. code-block:: shell
notify_mqtt:primary broker="tcp://mqtt-primary.example.net:port" password="" queue_dir="" queue_limit="0" reconnect_interval="0s" keep_alive_interval="0s" qos="0" topic="" username=""
notify_mqtt:secondary broker="tcp://mqtt-primary.example.net:port" password="" queue_dir="" queue_limit="0" reconnect_interval="0s" keep_alive_interval="0s" qos="0" topic="" username=""
The :mc-conf:`notify_mqtt` key is the top-level configuration key for an
:ref:`minio-server-config-bucket-notification-mqtt`. The
:mc-conf:`broker <notify_mqtt.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-cmd:`mc admin config set` command to set the new configuration
for the MQTT service endpoint:
.. code-block:: shell
:class: copyable
mc admin config set ALIAS/ notify_mqtt:<IDENTIFIER> \
url="MQTT://user:password@hostname:port" \
exchange="<string>" \
exchange_type="<string>" \
routing_key="<string>" \
mandatory="<string>" \
durable="<string>" \
no_wait="<string>" \
internal="<string>" \
auto_deleted="<string>" \
delivery_mode="<string>" \
queue_dir="<string>" \
queue_limit="<string>" \
comment="<string>"
The following configuration settings are the *minimum* required for an
MQTT server/broker endpoint:
- :mc-conf:`~notify_mqtt.broker`
- :mc-conf:`~notify_mqtt.topic`
- :mc-conf:`~notify_mqtt.username` *Required if the MQTT server/broker enforces authentication/authorization*
- :mc-conf:`~notify_mqtt.password` *Required if the MQTT server/broker enforces authentication/authorization*
All other configuration settings are *optional*. See
:ref:`minio-server-config-bucket-notification-mqtt` 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-cmd:`mc admin service restart` command to restart the deployment.
.. important::
MinIO restarts *all* :mc:`minio server` processes associated to the
deployment at the same time. Applications may experience a brief period of
downtime during the restart process.
Consider scheduling the restart during a maintenance period to minimize
interruption of services.
.. code-block:: shell
:class: copyable
mc admin service restart ALIAS
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the deployment to
restart.
The :mc:`minio server` process prints a line on startup for each configured MQTT
target similar to the following:
.. code-block:: shell
SQS ARNs: arn:minio:sqs::primary:mqtt
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 :mc-cmd:`events <mc-event-add-event>` 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-cmd:`mc cp` command to create a new object in the bucket and trigger
a notification.
.. code-block:: shell
:class: copyable
mc cp ~/data/new-object.txt ALIAS/BUCKET

View File

@ -0,0 +1,362 @@
.. _minio-bucket-notifications-publish-mysql:
=======================
Publish Events to MySQL
=======================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 1
MinIO supports publishing :ref:`bucket notification
<minio-bucket-notifications>` events to a My`MySQL <https://www.mysql.com/>`__
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
:ref:`bucket notifications <minio-bucket-notifications>` in a MinIO
deployment.
.. include:: /includes/common-admonitions.rst
:start-after: start-restart-downtime
:end-before: end-restart-downtime
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:`mc` command line tool for certain actions.
See the ``mc`` :ref:`Quickstart <mc-install>` 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.
.. tabs::
.. tab:: Environment Variables
MinIO supports specifying the MySQL service endpoint and associated
configuration settings using
:ref:`environment variables
<minio-server-envvar-bucket-notification-mysql>`. The
:mc:`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:
- :envvar:`MINIO_NOTIFY_MYSQL_ENABLE`
- :envvar:`MINIO_NOTIFY_MYSQL_DSN_STRING`
- :envvar:`MINIO_NOTIFY_MYSQL_TABLE`
- :envvar:`MINIO_NOTIFY_MYSQL_FORMAT`
.. code-block:: shell
:class: copyable
set MINIO_NOTIFY_MYSQL_DSN_STRING_<IDENTIFIER>="on"
set MINIO_NOTIFY_MYSQL_TABLE_<IDENTIFIER>="<ENDPOINT>"
set MINIO_NOTIFY_MYSQL_FORMAT_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_MYSQL_MAX_OPEN_CONNECTIONS_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_MYSQL_QUEUE_DIR_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_MYSQL_QUEUE_LIMIT_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_MYSQL_COMMENT_<IDENTIFIER>="<string>"
- 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 of ``PRIMARY``.
If the specified ``<IDENTIFIER>`` matches an existing MySQL service
endpoint on the MinIO deployment, the new settings *override*
any existing settings for that endpoint. Use
:mc-cmd:`mc admin config get notify_mysql <mc admin config get>` to
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 :ref:`MySQL Service for Bucket Notifications
<minio-server-envvar-bucket-notification-mysql>` for complete documentation
on each environment variable.
.. tab:: Configuration Settings
MinIO supports adding or updating MySQL endpoints on a running
:mc:`minio server` process using the :mc-cmd:`mc admin config set` command
and the :mc-conf:`notify_mysql` configuration key. You must restart the
:mc:`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:
- :mc-conf:`notify_mysql dsn_string <notify_mysql.dsn_string>`
- :mc-conf:`notify_mysql table <notify_mysql.table>`
- :mc-conf:`notify_mysql format <notify_mysql.format>`
.. code-block:: shell
:class: copyable
mc admin config set ALIAS/ notify_mysql:IDENTIFIER \
dsn_string="<ENDPOINT>" \
table="<string>" \
format="<string>" \
max_open_connections="<string>" \
queue_dir="<string>" \
queue_limit="<string>" \
comment="<string>"
- Replace ``IDENTIFIER`` with a unique descriptive string for the
MySQL service endpoint. The following examples in this procedure
assume an identifier of ``PRIMARY``.
If the specified ``IDENTIFIER`` matches an existing MySQL service
endpoint on the MinIO deployment, the new settings *override*
any existing settings for that endpoint. Use
:mc-cmd:`mc admin config get notify_mysql <mc admin config get>` to
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 :ref:`MySQL Bucket Notification Configuration Settings
<minio-server-config-bucket-notification-mysql>` for complete
documentation on each setting.
2) Restart the MinIO Deployment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You must restart the MinIO deployment to apply the configuration changes.
Use the :mc-cmd:`mc admin service restart` command to restart the deployment.
.. important::
MinIO restarts *all* :mc:`minio server` processes associated to the
deployment at the same time. Applications may experience a brief period of
downtime during the restart process.
Consider scheduling the restart during a maintenance period to minimize
interruption of services.
.. code-block:: shell
:class: copyable
mc admin service restart ALIAS
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the deployment to
restart.
The :mc:`minio server` process prints a line on startup for each configured MySQL
target similar to the following:
.. code-block:: shell
SQS ARNs: arn:minio:sqs::primary:mysql
You must specify the ARN resource when configuring bucket notifications with
the associated MySQL deployment as a target.
3) Configure Bucket Notifications using the MySQL Endpoint as a Target
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the :mc-cmd:`mc event add` command to add a new bucket notification
event with the configured MySQL service as a target:
.. code-block:: shell
:class: copyable
mc event add ALIAS/BUCKET arn:minio:sqs::primary:mysql \
--event EVENTS
- Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of a MinIO deployment.
- Replace ``BUCKET`` with the name of the bucket in which to configure the
event.
- Replace ``EVENTS`` with a comma-separated list of :ref:`events
<mc-event-supported-events>` for which MinIO triggers notifications.
Use :mc-cmd:`mc event list` to view all configured bucket events for
a given notification target:
.. code-block:: shell
:class: copyable
mc event list ALIAS/BUCKET arn:minio:sqs::primary:mysql
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 :mc-cmd:`events <mc-event-add-event>` 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-cmd:`mc cp` command to create a new object in the bucket and trigger
a notification.
.. code-block:: shell
:class: copyable
mc cp ~/data/new-object.txt ALIAS/BUCKET
Update a MySQL Endpoint in a MinIO Deployment
---------------------------------------------
The following procedure updates an existing MySQL service endpoint for supporting
:ref:`bucket notifications <minio-bucket-notifications>` in a MinIO
deployment.
.. include:: /includes/common-admonitions.rst
:start-after: start-restart-downtime
:end-before: end-restart-downtime
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:`mc` command line tool for certain actions.
See the ``mc`` :ref:`Quickstart <mc-install>` for installation instructions.
1) List Configured MySQL Endpoints In The Deployment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the :mc-cmd:`mc admin config get` command to list the currently
configured MySQL service endpoints in the deployment:
.. code-block:: shell
:class: copyable
mc admin config get ALIAS/ notify_mysql
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the MinIO deployment.
The command output resembles the following:
.. code-block:: shell
notify_mysql:primary format="namespace" table="minio_images" dsn_string="user:pass@tcp(mysql.example.com:3306)/miniodb"
notify_mysql:secondary format="namespace" table="minio_images" dsn_string="user:pass@tcp(mysql.example.com:3306)/miniodb"
The :mc-conf:`notify_mysql` key is the top-level configuration key for an
:ref:`minio-server-config-bucket-notification-mysql`. The
:mc-conf:`dsn_string <notify_mysql.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-cmd:`mc admin config set` command to set the new configuration
for the MySQL service endpoint:
.. code-block:: shell
:class: copyable
mc admin config set ALIAS/ notify_mysql:IDENTIFIER \
dsn_string="<ENDPOINT>" \
table="<string>" \
format="<string>" \
max_open_connections="<string>" \
queue_dir="<string>" \
queue_limit="<string>" \
comment="<string>"
The following configuration settings are the *minimum required* for a MySQL
service endpoint:
- :mc-conf:`notify_mysql dsn_string <notify_mysql.dsn_string>`
- :mc-conf:`notify_mysql table <notify_mysql.table>`
- :mc-conf:`notify_mysql format <notify_mysql.format>`
All other configuration settings are *optional*. See
:ref:`minio-server-config-bucket-notification-mysql` 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-cmd:`mc admin service restart` command to restart the deployment.
.. important::
MinIO restarts *all* :mc:`minio server` processes associated to the
deployment at the same time. Applications may experience a brief period of
downtime during the restart process.
Consider scheduling the restart during a maintenance period to minimize
interruption of services.
.. code-block:: shell
:class: copyable
mc admin service restart ALIAS
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the deployment to
restart.
The :mc:`minio server` process prints a line on startup for each configured MySQL
target similar to the following:
.. code-block:: shell
SQS ARNs: arn:minio:sqs::primary:mysql
3) 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 :mc-cmd:`events <mc-event-add-event>` 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-cmd:`mc cp` command to create a new object in the bucket and trigger
a notification.
.. code-block:: shell
:class: copyable
mc cp ~/data/new-object.txt ALIAS/BUCKET

View File

@ -0,0 +1,362 @@
.. _minio-bucket-notifications-publish-nats:
======================
Publish Events to NATS
======================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 1
MinIO supports publishing :ref:`bucket notification
<minio-bucket-notifications>` events to a
`NATS <https://nats.io/>`__ service endpoint.
Add a NATS Endpoint to a MinIO Deployment
-----------------------------------------
The following procedure adds a new NATS service endpoint for supporting
:ref:`bucket notifications <minio-bucket-notifications>` in a MinIO
deployment.
.. include:: /includes/common-admonitions.rst
:start-after: start-restart-downtime
:end-before: end-restart-downtime
Prerequisites
~~~~~~~~~~~~~
MinIO ``mc`` Command Line Tool
++++++++++++++++++++++++++++++
This procedure uses the :mc:`mc` command line tool for certain actions.
See the ``mc`` :ref:`Quickstart <mc-install>` 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.
.. tabs::
.. tab:: Environment Variables
MinIO supports specifying the NATS service endpoint and associated
configuration settings using
:ref:`environment variables
<minio-server-envvar-bucket-notification-nats>`. The
:mc:`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
:envvar:`MINIO_NOTIFY_NATS_ADDRESS` and
:envvar:`MINIO_NOTIFY_NATS_SUBJECT`:
.. code-block:: shell
:class: copyable
set MINIO_NOTIFY_NATS_ENABLE_<IDENTIFIER>="on"
set MINIO_NOTIFY_NATS_ADDRESS_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_NATS_SUBJECT_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_NATS_USERNAME_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_NATS_PASSWORD_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_NATS_TOKEN_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_NATS_TLS_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_NATS_TLS_SKIP_VERIFY_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_NATS_PING_INTERVAL_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_NATS_STREAMING_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_NATS_STREAMING_ASYNC_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_NATS_STREAMING_MAX_PUB_ACKS_IN_FLIGHT_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_NATS_STREAMING_CLUSTER_ID_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_NATS_CERT_AUTHORITY_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_NATS_CLIENT_CERT_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_NATS_CLIENT_KEY_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_NATS_QUEUE_DIR_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_NATS_QUEUE_LIMIT_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_NATS_COMMENT_<IDENTIFIER>="<string>"
- 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 of ``PRIMARY``.
If the specified ``<IDENTIFIER>`` matches an existing NATS service
endpoint on the MinIO deployment, the new settings *override*
any existing settings for that endpoint. Use
:mc-cmd:`mc admin config get notify_nats <mc admin config get>` to
review the currently configured NATS endpoints on the MinIO deployment.
- Replace ``<ENDPOINT>`` with the URL of the NATS service endpoint.
For example: ``htpps://nats-endpoint.example.com:4222``
See :ref:`NATS Service for Bucket Notifications
<minio-server-envvar-bucket-notification-nats>` for complete documentation
on each environment variable.
.. tab:: Configuration Settings
MinIO supports adding or updating NATS endpoints on a running
:mc:`minio server` process using the :mc-cmd:`mc admin config set` command
and the :mc-conf:`notify_nats` configuration key. You must restart the
:mc:`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
:mc-conf:`notify_nats address <notify_nats.address>` and
:mc-conf:`notify_nats subject <notify_nats.subject>`:
.. code-block:: shell
:class: copyable
mc admin config set ALIAS/ notify_nats:IDENTIFIER \
address="HOSTNAME" \
subject="<string>" \
username="<string>" \
password="<string>" \
token="<string>" \
tls="<string>" \
tls_skip_verify="<string>" \
ping_interval="<string>" \
streaming="<string>" \
streaming_async="<string>" \
streaming_max_pub_acks_in_flight="<string>" \
streaming_cluster_id="<string>" \
cert_authority="<string>" \
client_cert="<string>" \
client_key="<string>" \
queue_dir="<string>" \
queue_limit="<string>" \
comment="<string>"
- Replace ``IDENTIFIER`` with a unique descriptive string for the
NATS service endpoint. The following examples in this procedure
assume an identifier of ``PRIMARY``.
If the specified ``IDENTIFIER`` matches an existing NATS service
endpoint on the MinIO deployment, the new settings *override*
any existing settings for that endpoint. Use
:mc-cmd:`mc admin config get notify_nats <mc admin config get>` to
review the currently configured NATS endpoints on the MinIO deployment.
- Replace ``ENDPOINT`` with the URL of the NATS service endpoint.
For example: ``htpps://nats-endpoint.example.com:4222``.
See :ref:`NATS Bucket Notification Configuration Settings
<minio-server-config-bucket-notification-nats>` for complete
documentation on each setting.
2) Restart the MinIO Deployment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You must restart the MinIO deployment to apply the configuration changes.
Use the :mc-cmd:`mc admin service restart` command to restart the deployment.
.. important::
MinIO restarts *all* :mc:`minio server` processes associated to the
deployment at the same time. Applications may experience a brief period of
downtime during the restart process.
Consider scheduling the restart during a maintenance period to minimize
interruption of services.
.. code-block:: shell
:class: copyable
mc admin service restart ALIAS
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the deployment to
restart.
The :mc:`minio server` process prints a line on startup for each configured NATS
target similar to the following:
.. code-block:: shell
SQS ARNs: arn:minio:sqs::primary:nats
You must specify the ARN resource when configuring bucket notifications with
the associated NATS deployment as a target.
3) Configure Bucket Notifications using the NATS Endpoint as a Target
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the :mc-cmd:`mc event add` command to add a new bucket notification
event with the configured NATS service as a target:
.. code-block:: shell
:class: copyable
mc event add ALIAS/BUCKET arn:minio:sqs::primary:nats \
--event EVENTS
- Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of a MinIO deployment.
- Replace ``BUCKET`` with the name of the bucket in which to configure the
event.
- Replace ``EVENTS`` with a comma-separated list of :ref:`events
<mc-event-supported-events>` for which MinIO triggers notifications.
Use :mc-cmd:`mc event list` to view all configured bucket events for
a given notification target:
.. code-block:: shell
:class: copyable
mc event list ALIAS/BUCKET arn:minio:sqs::primary:nats
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 :mc-cmd:`events <mc-event-add-event>` 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-cmd:`mc cp` command to create a new object in the bucket and trigger
a notification.
.. code-block:: shell
:class: copyable
mc cp ~/data/new-object.txt ALIAS/BUCKET
Update an NATS Endpoint in a MinIO Deployment
---------------------------------------------
The following procedure updates an existing NATS service endpoint for supporting
:ref:`bucket notifications <minio-bucket-notifications>` in a MinIO
deployment.
.. include:: /includes/common-admonitions.rst
:start-after: start-restart-downtime
:end-before: end-restart-downtime
Prerequisites
~~~~~~~~~~~~~~
MinIO ``mc`` Command Line Tool
++++++++++++++++++++++++++++++
This procedure uses the :mc:`mc` command line tool for certain actions.
See the ``mc`` :ref:`Quickstart <mc-install>` for installation instructions.
1) List Configured NATS Endpoints In The Deployment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the :mc-cmd:`mc admin config get` command to list the currently
configured NATS service endpoints in the deployment:
.. code-block:: shell
:class: copyable
mc admin config get ALIAS/ notify_nats
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the MinIO deployment.
The command output resembles the following:
.. code-block:: shell
notify_nats:primary password="yoursecret" streaming_max_pub_acks_in_flight="10" subject="" address="nats-endpoint.example.com:4222" token="" username="yourusername" ping_interval="0" queue_limit="0" tls="off" tls_skip_verify="off" streaming_async="on" queue_dir="" streaming_cluster_id="test-cluster" streaming_enable="on"
notify_nats:secondary password="yoursecret" streaming_max_pub_acks_in_flight="10" subject="" address="nats-endpoint.example.com:4222" token="" username="yourusername" ping_interval="0" queue_limit="0" tls="off" tls_skip_verify="off" streaming_async="on" queue_dir="" streaming_cluster_id="test-cluster" streaming_enable="on"
The :mc-conf:`notify_nats` key is the top-level configuration key for an
:ref:`minio-server-config-bucket-notification-nats`. The
:mc-conf:`address <notify_nats.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-cmd:`mc admin config set` command to set the new configuration
for the NATS service endpoint:
.. code-block:: shell
:class: copyable
mc admin config set ALIAS/ notify_nats:IDENTIFIER \
address="HOSTNAME" \
subject="<string>" \
username="<string>" \
password="<string>" \
token="<string>" \
tls="<string>" \
tls_skip_verify="<string>" \
ping_interval="<string>" \
streaming="<string>" \
streaming_async="<string>" \
streaming_max_pub_acks_in_flight="<string>" \
streaming_cluster_id="<string>" \
cert_authority="<string>" \
client_cert="<string>" \
client_key="<string>" \
queue_dir="<string>" \
queue_limit="<string>" \
comment="<string>"
The :mc-conf:`notify_nats address <notify_nats.address>` configuration setting
is the *minimum* required for an NATS service endpoint. All other configuration
settings are *optional*. See :ref:`minio-server-config-bucket-notification-nats`
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-cmd:`mc admin service restart` command to restart the deployment.
.. important::
MinIO restarts *all* :mc:`minio server` processes associated to the
deployment at the same time. Applications may experience a brief period of
downtime during the restart process.
Consider scheduling the restart during a maintenance period to minimize
interruption of services.
.. code-block:: shell
:class: copyable
mc admin service restart ALIAS
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the deployment to
restart.
The :mc:`minio server` process prints a line on startup for each configured NATS
target similar to the following:
.. code-block:: shell
SQS ARNs: arn:minio:sqs::primary:nats
3) 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 :mc-cmd:`events <mc-event-add-event>` 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-cmd:`mc cp` command to create a new object in the bucket and trigger
a notification.
.. code-block:: shell
:class: copyable
mc cp ~/data/new-object.txt ALIAS/BUCKET

View File

@ -0,0 +1,333 @@
.. _minio-bucket-notifications-publish-nsq:
=====================
Publish Events to NSQ
=====================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 1
MinIO supports publishing :ref:`bucket notification
<minio-bucket-notifications>` events to `NSQ <https://nsq.io/>`__
service endpoint.
Add a NSQ Endpoint to a MinIO Deployment
----------------------------------------
The following procedure adds a new NSQ service endpoint for supporting
:ref:`bucket notifications <minio-bucket-notifications>` in a MinIO
deployment.
.. include:: /includes/common-admonitions.rst
:start-after: start-restart-downtime
:end-before: end-restart-downtime
Prerequisites
~~~~~~~~~~~~~
MinIO ``mc`` Command Line Tool
++++++++++++++++++++++++++++++
This procedure uses the :mc:`mc` command line tool for certain actions.
See the ``mc`` :ref:`Quickstart <mc-install>` 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.
.. tabs::
.. tab:: Environment Variables
MinIO supports specifying the NSQ service endpoint and associated
configuration settings using
:ref:`environment variables
<minio-server-envvar-bucket-notification-nsq>`. The
:mc:`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
:envvar:`MINIO_NOTIFY_NSQ_NSQD_ADDRESS` and
:envvar:`MINIO_NOTIFY_NSQ_TOPIC`:
.. code-block:: shell
:class: copyable
set MINIO_NOTIFY_NSQ_ENABLE_<IDENTIFIER>="on"
set MINIO_NOTIFY_NSQ_NSQD_ADDRESS_<IDENTIFIER>="<ENDPOINT>"
set MINIO_NOTIFY_NSQ_TOPIC_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_NSQ_TLS_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_NSQ_TLS_SKIP_VERIFY_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_NSQ_QUEUE_DIR_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_NSQ_QUEUE_LIMIT_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_NSQ_COMMENT_<IDENTIFIER>="<string>"
- 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 of ``PRIMARY``.
If the specified ``<IDENTIFIER>`` matches an existing NSQ service
endpoint on the MinIO deployment, the new settings *override*
any existing settings for that endpoint. Use
:mc-cmd:`mc admin config get notify_nsq <mc admin config get>` to
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 :ref:`NSQ Service for Bucket Notifications
<minio-server-envvar-bucket-notification-nsq>` for complete documentation
on each environment variable.
.. tab:: Configuration Settings
MinIO supports adding or updating NSQ endpoints on a running
:mc:`minio server` process using the :mc-cmd:`mc admin config set` command
and the :mc-conf:`notify_nsq` configuration key. You must restart the
:mc:`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
:mc-conf:`notify_nsq nsqd_address <notify_nsq.nsqd_address>` and
:mc-conf:`notify_nsq topic <notify_nsq.topic>`:
.. code-block:: shell
:class: copyable
mc admin config set ALIAS/ notify_nsq:IDENTIFIER \
nsqd_address="ENDPOINT" \
topic="<string>" \
tls="<string>" \
tls_skip_verify="<string>" \
queue_dir="<string>" \
queue_limit="<string>" \
comment="<string>"
- Replace ``IDENTIFIER`` with a unique descriptive string for the
NSQ service endpoint. The following examples in this procedure
assume an identifier of ``PRIMARY``.
If the specified ``IDENTIFIER`` matches an existing NSQ service
endpoint on the MinIO deployment, the new settings *override*
any existing settings for that endpoint. Use
:mc-cmd:`mc admin config get notify_nsq <mc admin config get>` to
review the currently configured NSQ endpoints on the MinIO deployment.
- Replace ``ENDPOINT`` with the URL of the NSQ service endpoint.
For example:
``NSQ://user:password@hostname:port``
See :ref:`NSQ Bucket Notification Configuration Settings
<minio-server-config-bucket-notification-nsq>` for complete
documentation on each setting.
2) Restart the MinIO Deployment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You must restart the MinIO deployment to apply the configuration changes.
Use the :mc-cmd:`mc admin service restart` command to restart the deployment.
.. important::
MinIO restarts *all* :mc:`minio server` processes associated to the
deployment at the same time. Applications may experience a brief period of
downtime during the restart process.
Consider scheduling the restart during a maintenance period to minimize
interruption of services.
.. code-block:: shell
:class: copyable
mc admin service restart ALIAS
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the deployment to
restart.
The :mc:`minio server` process prints a line on startup for each configured NSQ
target similar to the following:
.. code-block:: shell
SQS ARNs: arn:minio:sqs::primary:nsq
You must specify the ARN resource when configuring bucket notifications with
the associated NSQ deployment as a target.
3) Configure Bucket Notifications using the NSQ Endpoint as a Target
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the :mc-cmd:`mc event add` command to add a new bucket notification
event with the configured NSQ service as a target:
.. code-block:: shell
:class: copyable
mc event add ALIAS/BUCKET arn:minio:sqs::primary:nsq \
--event EVENTS
- Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of a MinIO deployment.
- Replace ``BUCKET`` with the name of the bucket in which to configure the
event.
- Replace ``EVENTS`` with a comma-separated list of :ref:`events
<mc-event-supported-events>` for which MinIO triggers notifications.
Use :mc-cmd:`mc event list` to view all configured bucket events for
a given notification target:
.. code-block:: shell
:class: copyable
mc event list ALIAS/BUCKET arn:minio:sqs::primary:nsq
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 :mc-cmd:`events <mc-event-add-event>` 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-cmd:`mc cp` command to create a new object in the bucket and trigger
a notification.
.. code-block:: shell
:class: copyable
mc cp ~/data/new-object.txt ALIAS/BUCKET
Update an NSQ Endpoint in a MinIO Deployment
--------------------------------------------
The following procedure updates an existing NSQ service endpoint for supporting
:ref:`bucket notifications <minio-bucket-notifications>` in a MinIO
deployment.
.. include:: /includes/common-admonitions.rst
:start-after: start-restart-downtime
:end-before: end-restart-downtime
Prerequisites
~~~~~~~~~~~~~~
MinIO ``mc`` Command Line Tool
++++++++++++++++++++++++++++++
This procedure uses the :mc:`mc` command line tool for certain actions.
See the ``mc`` :ref:`Quickstart <mc-install>` for installation instructions.
1) List Configured NSQ Endpoints In The Deployment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the :mc-cmd:`mc admin config get` command to list the currently
configured NSQ service endpoints in the deployment:
.. code-block:: shell
:class: copyable
mc admin config get ALIAS/ notify_nsq
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the MinIO deployment.
The command output resembles the following:
.. code-block:: shell
notify_nsq:primary nsqd_address="https://nsq.example.com" queue_dir="" queue_limit="0" tls="off" tls_skip_verify="off" topic=""
notify_nsq:secondary nsqd_address="https://nsq.example.com" queue_dir="" queue_limit="0" tls="off" tls_skip_verify="off" topic=""
The :mc-conf:`notify_nsq` key is the top-level configuration key for an
:ref:`minio-server-config-bucket-notification-nsq`. The :mc-conf:`nsqd_address
<notify_nsq.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-cmd:`mc admin config set` command to set the new configuration
for the NSQ service endpoint:
.. code-block:: shell
:class: copyable
mc admin config set ALIAS/ notify_nsq:<IDENTIFIER> \
nsqd_address="NSQ://user:password@hostname:port" \
topic="<string>" \
tls="<string>" \
tls_skip_verify="<string>" \
queue_dir="<string>" \
queue_limit="<string>" \
comment="<string>"
The :mc-conf:`notify_nsq nsqd_address <notify_nsq.nsqd_address>` configuration
setting is the *minimum* required for an NSQ service endpoint. All other
configuration settings are *optional*. See
:ref:`minio-server-config-bucket-notification-nsq` 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-cmd:`mc admin service restart` command to restart the deployment.
.. important::
MinIO restarts *all* :mc:`minio server` processes associated to the
deployment at the same time. Applications may experience a brief period of
downtime during the restart process.
Consider scheduling the restart during a maintenance period to minimize
interruption of services.
.. code-block:: shell
:class: copyable
mc admin service restart ALIAS
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the deployment to
restart.
The :mc:`minio server` process prints a line on startup for each configured NSQ
target similar to the following:
.. code-block:: shell
SQS ARNs: arn:minio:sqs::primary:NSQ
3) 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 :mc-cmd:`events <mc-event-add-event>` 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-cmd:`mc cp` command to create a new object in the bucket and trigger
a notification.
.. code-block:: shell
:class: copyable
mc cp ~/data/new-object.txt ALIAS/BUCKET

View File

@ -0,0 +1,367 @@
.. _minio-bucket-notifications-publish-postgresql:
============================
Publish Events to PostgreSQL
============================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 1
.. |postgresql-uri-reference| replace:: `PostgreSQL Connection String <https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING>`__
MinIO supports publishing :ref:`bucket notification
<minio-bucket-notifications>` events to
`PostgreSQL <https://www.postgresql.org/>`__. 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
:ref:`bucket notifications <minio-bucket-notifications>` in a MinIO
deployment.
.. include:: /includes/common-admonitions.rst
:start-after: start-restart-downtime
:end-before: end-restart-downtime
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:`mc` command line tool for certain actions.
See the ``mc`` :ref:`Quickstart <mc-install>` 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.
.. tabs::
.. tab:: Environment Variables
MinIO supports specifying the PostgreSQL service endpoint and associated
configuration settings using
:ref:`environment variables
<minio-server-envvar-bucket-notification-postgresql>`. The
:mc:`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:
- :envvar:`MINIO_NOTIFY_POSTGRESQL_CONNECTION_STRING`
- :envvar:`MINIO_NOTIFY_POSTGRESQL_TABLE`
- :envvar:`MINIO_NOTIFY_POSTGRESQL_FORMAT`
.. code-block:: shell
:class: copyable
set MINIO_NOTIFY_CONNECTION_STRING_<IDENTIFIER>="on"
set MINIO_NOTIFY_TABLE_<IDENTIFIER>="ENDPOINT"
set MINIO_NOTIFY_FORMAT_<IDENTIFIER>=""
set MINIO_NOTIFY_MAX_OPEN_CONNECTIONS_<IDENTIFIER>=""
set MINIO_NOTIFY_QUEUE_DIR_<IDENTIFIER>=""
set MINIO_NOTIFY_QUEUE_LIMIT_<IDENTIFIER>=""
set MINIO_NOTIFY_COMMENT_<IDENTIFIER>=""
- 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 of ``PRIMARY``.
If the specified ``<IDENTIFIER>`` matches an existing PostgreSQL service
endpoint on the MinIO deployment, the new settings *override*
any existing settings for that endpoint. Use
:mc-cmd:`mc admin config get notify_postgresql <mc admin config get>` to
review the currently configured PostgreSQL endpoints on the MinIO deployment.
- Replace ``<ENDPOINT>`` with the |postgresql-uri-reference|
for PostgreSQL service endpoint. MinIO supports ``key=value`` format 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-uri-reference|.
See :ref:`PostgreSQL Service for Bucket Notifications
<minio-server-envvar-bucket-notification-postgresql>` for complete
documentation on each environment variable.
.. tab:: Configuration Settings
MinIO supports adding or updating PostgreSQL endpoints on a running
:mc:`minio server` process using the :mc-cmd:`mc admin config set` command
and the :mc-conf:`notify_postgresql` configuration key. You must restart the
:mc:`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:
- :mc-conf:`notify_postgresql connection_string
<notify_postgresql.connection_string>`
- :mc-conf:`notify_postgresql table <notify_postgresql.table>`
- :mc-conf:`notify_postgresql format <notify_postgresql.format>`
.. code-block:: shell
:class: copyable
mc admin config set ALIAS/ notify_postgresql:IDENTIFIER \
connection_string="ENDPOINT" \
table="<string>" \
format="<string>" \
max_open_connections="<string>" \
queue_dir="<string>" \
queue_limit="<string>" \
comment="<string>"
- Replace ``IDENTIFIER`` with a unique descriptive string for the
PostgreSQL service endpoint. The following examples in this procedure
assume an identifier of ``PRIMARY``.
If the specified ``IDENTIFIER`` matches an existing PostgreSQL service
endpoint on the MinIO deployment, the new settings *override*
any existing settings for that endpoint. Use
:mc-cmd:`mc admin config get notify_postgresql <mc admin config get>` to
review the currently configured PostgreSQL endpoints on the MinIO deployment.
- Replace ``<ENDPOINT>`` with the `PostgreSQL URI connection string
<https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING>`__
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 |postgresql-uri-reference|.
See :ref:`PostgreSQL Bucket Notification Configuration Settings
<minio-server-config-bucket-notification-postgresql>` for complete
documentation on each setting.
2) Restart the MinIO Deployment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You must restart the MinIO deployment to apply the configuration changes.
Use the :mc-cmd:`mc admin service restart` command to restart the deployment.
.. important::
MinIO restarts *all* :mc:`minio server` processes associated to the
deployment at the same time. Applications may experience a brief period of
downtime during the restart process.
Consider scheduling the restart during a maintenance period to minimize
interruption of services.
.. code-block:: shell
:class: copyable
mc admin service restart ALIAS
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the deployment to
restart.
The :mc:`minio server` process prints a line on startup for each configured PostgreSQL
target similar to the following:
.. code-block:: shell
SQS ARNs: arn:minio:sqs::primary:postgresql
You must specify the ARN resource when configuring bucket notifications with
the associated PostgreSQL deployment as a target.
3) Configure Bucket Notifications using the PostgreSQL Endpoint as a Target
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the :mc-cmd:`mc event add` command to add a new bucket notification
event with the configured PostgreSQL service as a target:
.. code-block:: shell
:class: copyable
mc event add ALIAS/BUCKET arn:minio:sqs::primary:postgresql \
--event EVENTS
- Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of a MinIO deployment.
- Replace ``BUCKET`` with the name of the bucket in which to configure the
event.
- Replace ``EVENTS`` with a comma-separated list of :ref:`events
<mc-event-supported-events>` for which MinIO triggers notifications.
Use :mc-cmd:`mc event list` to view all configured bucket events for
a given notification target:
.. code-block:: shell
:class: copyable
mc event list ALIAS/BUCKET arn:minio:sqs::primary:postgresql
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 :mc-cmd:`events <mc-event-add-event>` 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-cmd:`mc cp` command to create a new object in the bucket and trigger
a notification.
.. code-block:: shell
:class: copyable
mc cp ~/data/new-object.txt ALIAS/BUCKET
Update a PostgreSQL Endpoint in a MinIO Deployment
---------------------------------------------------
The following procedure updates an existing PostgreSQL service endpoint for
supporting :ref:`bucket notifications <minio-bucket-notifications>` in a MinIO
deployment.
.. include:: /includes/common-admonitions.rst
:start-after: start-restart-downtime
:end-before: end-restart-downtime
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:`mc` command line tool for certain actions.
See the ``mc`` :ref:`Quickstart <mc-install>` for installation instructions.
1) List Configured PostgreSQL Endpoints In The Deployment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the :mc-cmd:`mc admin config get` command to list the currently
configured PostgreSQL service endpoints in the deployment:
.. code-block:: shell
:class: copyable
mc admin config get ALIAS/ notify_postgresql
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the MinIO deployment.
The command output resembles the following:
.. code-block:: shell
notify_postgresql:primary queue_dir="" connection_string="postgresql://" queue_limit="0" table="" format="namespace"
notify_postgresql:secondary queue_dir="" connection_string="" queue_limit="0" table="" format="namespace"
The :mc-conf:`notify_postgresql` key is the top-level configuration key for an
:ref:`minio-server-config-bucket-notification-postgresql`. The
:mc-conf:`connection_string <notify_postgresql.connection_string>` key specifies
the PostgreSQL service endpoint for the given `notify_postgresql` key. The
``notify_postgresql:<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-cmd:`mc admin config set` command to set the new configuration
for the PostgreSQL service endpoint:
.. code-block:: shell
:class: copyable
mc admin config set ALIAS/ notify_postgresql:IDENTIFIER \
connection_string="ENDPOINT" \
table="<string>" \
format="<string>" \
max_open_connections="<string>" \
queue_dir="<string>" \
queue_limit="<string>" \
comment="<string>"
The following configuration settings are the *minimum* required for a
PostgreSQL service endpoint:
- :mc-conf:`notify_postgresql connection_string
<notify_postgresql.connection_string>`
- :mc-conf:`notify_postgresql table <notify_postgresql.table>`
- :mc-conf:`notify_postgresql format <notify_postgresql.format>`
All other configuration settings are *optional*. See
:ref:`minio-server-config-bucket-notification-postgresql` 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-cmd:`mc admin service restart` command to restart the deployment.
.. important::
MinIO restarts *all* :mc:`minio server` processes associated to the
deployment at the same time. Applications may experience a brief period of
downtime during the restart process.
Consider scheduling the restart during a maintenance period to minimize
interruption of services.
.. code-block:: shell
:class: copyable
mc admin service restart ALIAS
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the deployment to
restart.
The :mc:`minio server` process prints a line on startup for each configured PostgreSQL
target similar to the following:
.. code-block:: shell
SQS ARNs: arn:minio:sqs::primary:postgresql
3) 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 :mc-cmd:`events <mc-event-add-event>` 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-cmd:`mc cp` command to create a new object in the bucket and trigger
a notification.
.. code-block:: shell
:class: copyable
mc cp ~/data/new-object.txt ALIAS/BUCKET

View File

@ -0,0 +1,335 @@
.. _minio-bucket-notifications-publish-redis:
=======================
Publish Events to Redis
=======================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 1
MinIO supports publishing :ref:`bucket notification
<minio-bucket-notifications>` events to a `Redis <https://redis.io/>`__
service endpoint.
Add a Redis Endpoint to a MinIO Deployment
-------------------------------------------
The following procedure adds a new Redis service endpoint for supporting
:ref:`bucket notifications <minio-bucket-notifications>` in a MinIO
deployment.
.. include:: /includes/common-admonitions.rst
:start-after: start-restart-downtime
:end-before: end-restart-downtime
Prerequisites
~~~~~~~~~~~~~
MinIO ``mc`` Command Line Tool
++++++++++++++++++++++++++++++
This procedure uses the :mc:`mc` command line tool for certain actions.
See the ``mc`` :ref:`Quickstart <mc-install>` 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.
.. tabs::
.. tab:: Environment Variables
MinIO supports specifying the Redis service endpoint and associated
configuration settings using
:ref:`environment variables
<minio-server-envvar-bucket-notification-redis>`. The
:mc:`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:
- :envvar:`MINIO_NOTIFY_REDIS_ENABLE`
- :envvar:`MINIO_NOTIFY_REDIS_ADDRESS`
- :envvar:`MINIO_NOTIFY_REDIS_KEY`
- :envvar:`MINIO_NOTIFY_REDIS_FORMAT`
.. code-block:: shell
:class: copyable
set MINIO_NOTIFY_REDIS_ENABLE_<IDENTIFIER>="on"
set MINIO_NOTIFY_REDIS_ADDRESS_<IDENTIFIER>="<ENDPOINT>"
set MINIO_NOTIFY_REDIS_KEY_<IDENTIFIER>="<STRING>"
set MINIO_NOTIFY_REDIS_FORMAT_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_REDIS_PASSWORD_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_REDIS_QUEUE_DIR_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_REDIS_QUEUE_LIMIT_<IDENTIFIER>="<string>"
set MINIO_NOTIFY_REDIS_COMMENT_<IDENTIFIER>="<string>"
- 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 of ``PRIMARY``.
If the specified ``<IDENTIFIER>`` matches an existing Redis service
endpoint on the MinIO deployment, the new settings *override*
any existing settings for that endpoint. Use
:mc-cmd:`mc admin config get notify_redis <mc admin config get>` to
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 :ref:`Redis Service for Bucket Notifications
<minio-server-envvar-bucket-notification-redis>` for complete documentation
on each environment variable.
.. tab:: Configuration Settings
MinIO supports adding or updating Redis endpoints on a running
:mc:`minio server` process using the :mc-cmd:`mc admin config set` command
and the :mc-conf:`notify_redis` configuration key. You must restart the
:mc:`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:
- :mc-conf:`notify_redis address <notify_redis.address>`
- :mc-conf:`notify_redis key <notify_redis.key>`
- :mc-conf:`notify_redis format <notify_redis.format>`
.. code-block:: shell
:class: copyable
mc admin config set ALIAS/ notify_redis:IDENTIFIER \
address="ENDPOINT" \
key="<string>" \
format="<string>" \
password="<string>" \
queue_dir="<string>" \
queue_limit="<string>" \
comment="<string>"
- Replace ``IDENTIFIER`` with a unique descriptive string for the
Redis service endpoint. The following examples in this procedure
assume an identifier of ``PRIMARY``.
If the specified ``IDENTIFIER`` matches an existing Redis service
endpoint on the MinIO deployment, the new settings *override*
any existing settings for that endpoint. Use
:mc-cmd:`mc admin config get notify_redis <mc admin config get>` to
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 :ref:`Redis Bucket Notification Configuration Settings
<minio-server-config-bucket-notification-redis>` for complete
documentation on each setting.
2) Restart the MinIO Deployment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You must restart the MinIO deployment to apply the configuration changes.
Use the :mc-cmd:`mc admin service restart` command to restart the deployment.
.. important::
MinIO restarts *all* :mc:`minio server` processes associated to the
deployment at the same time. Applications may experience a brief period of
downtime during the restart process.
Consider scheduling the restart during a maintenance period to minimize
interruption of services.
.. code-block:: shell
:class: copyable
mc admin service restart ALIAS
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the deployment to
restart.
The :mc:`minio server` process prints a line on startup for each configured Redis
target similar to the following:
.. code-block:: shell
SQS ARNs: arn:minio:sqs::primary:redis
You must specify the ARN resource when configuring bucket notifications with
the associated Redis deployment as a target.
3) Configure Bucket Notifications using the Redis Endpoint as a Target
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the :mc-cmd:`mc event add` command to add a new bucket notification
event with the configured Redis service as a target:
.. code-block:: shell
:class: copyable
mc event add ALIAS/BUCKET arn:minio:sqs::primary:redis \
--event EVENTS
- Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of a MinIO deployment.
- Replace ``BUCKET`` with the name of the bucket in which to configure the
event.
- Replace ``EVENTS`` with a comma-separated list of :ref:`events
<mc-event-supported-events>` for which MinIO triggers notifications.
Use :mc-cmd:`mc event list` to view all configured bucket events for
a given notification target:
.. code-block:: shell
:class: copyable
mc event list ALIAS/BUCKET arn:minio:sqs::primary:redis
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 :mc-cmd:`events <mc-event-add-event>` 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-cmd:`mc cp` command to create a new object in the bucket and trigger
a notification.
.. code-block:: shell
:class: copyable
mc cp ~/data/new-object.txt ALIAS/BUCKET
Update an Redis Endpoint in a MinIO Deployment
----------------------------------------------
The following procedure updates an existing Redis service endpoint for
supporting :ref:`bucket notifications <minio-bucket-notifications>` in a MinIO
deployment.
.. include:: /includes/common-admonitions.rst
:start-after: start-restart-downtime
:end-before: end-restart-downtime
Prerequisites
~~~~~~~~~~~~~~
MinIO ``mc`` Command Line Tool
++++++++++++++++++++++++++++++
This procedure uses the :mc:`mc` command line tool for certain actions.
See the ``mc`` :ref:`Quickstart <mc-install>` for installation instructions.
1) List Configured Redis Endpoints In The Deployment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the :mc-cmd:`mc admin config get` command to list the currently
configured Redis service endpoints in the deployment:
.. code-block:: shell
:class: copyable
mc admin config get ALIAS/ notify_redis
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the MinIO deployment.
The command output resembles the following:
.. code-block:: shell
notify_redis:primary address="https://redis.example.com:6369" format="namespace" key="minioevent" password="" queue_dir="" queue_limit="0"
notify_redis:secondary address="https://redis.example.com:6369" format="namespace" key="minioevent" password="" queue_dir="" queue_limit="0"
The :mc-conf:`notify_redis` key is the top-level configuration key for an
:ref:`minio-server-config-bucket-notification-redis`. The
:mc-conf:`address <notify_redis.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-cmd:`mc admin config set` command to set the new configuration
for the Redis service endpoint:
.. code-block:: shell
:class: copyable
mc admin config set ALIAS/ notify_redis:IDENTIFIER \
address="ENDPOINT" \
key="<string>" \
format="<string>" \
password="<string>" \
queue_dir="<string>" \
queue_limit="<string>" \
comment="<string>"
The :mc-conf:`notify_redis address <notify_redis.address>` configuration setting
is the *minimum* required for an Redis service endpoint. All other configuration
settings are *optional*. See
:ref:`minio-server-config-bucket-notification-redis` 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-cmd:`mc admin service restart` command to restart the deployment.
.. important::
MinIO restarts *all* :mc:`minio server` processes associated to the
deployment at the same time. Applications may experience a brief period of
downtime during the restart process.
Consider scheduling the restart during a maintenance period to minimize
interruption of services.
.. code-block:: shell
:class: copyable
mc admin service restart ALIAS
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the deployment to
restart.
The :mc:`minio server` process prints a line on startup for each configured Redis
target similar to the following:
.. code-block:: shell
SQS ARNs: arn:minio:sqs::primary:redis
3) 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 :mc-cmd:`events <mc-event-add-event>` 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-cmd:`mc cp` command to create a new object in the bucket and trigger
a notification.
.. code-block:: shell
:class: copyable
mc cp ~/data/new-object.txt ALIAS/BUCKET

View File

@ -0,0 +1,333 @@
.. _minio-bucket-notifications-publish-webhook:
=========================
Publish Events to Webhook
=========================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 1
MinIO supports publishing :ref:`bucket notification
<minio-bucket-notifications>` events to a
`Webhook <https://en.wikipedia.org/wiki/Webhook>`__ service endpoint.
Add a Webhook Endpoint to a MinIO Deployment
--------------------------------------------
The following procedure adds a new Webhook service endpoint for supporting
:ref:`bucket notifications <minio-bucket-notifications>` in a MinIO
deployment.
.. include:: /includes/common-admonitions.rst
:start-after: start-restart-downtime
:end-before: end-restart-downtime
Prerequisites
~~~~~~~~~~~~~
MinIO ``mc`` Command Line Tool
++++++++++++++++++++++++++++++
This procedure uses the :mc:`mc` command line tool for certain actions.
See the ``mc`` :ref:`Quickstart <mc-install>` 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.
.. tabs::
.. tab:: Environment Variables
MinIO supports specifying the Webhook service endpoint and associated
configuration settings using
:ref:`environment variables
<minio-server-envvar-bucket-notification-webhook>`. The
:mc:`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
:envvar:`MINIO_NOTIFY_WEBHOOK_ENABLE` and
:envvar:`MINIO_NOTIFY_WEBHOOK_ENDPOINT`:
.. code-block:: shell
:class: copyable
set MINIO_NOTIFY_WEBHOOK_ENABLE_<IDENTIFIER>_="on"
set MINIO_NOTIFY_WEBHOOK_ENDPOINT_<IDENTIFIER>_="ENDPOINT"
set MINIO_NOTIFY_WEBHOOK_AUTH_TOKEN_<IDENTIFIER>_="<string>"
set MINIO_NOTIFY_WEBHOOK_QUEUE_DIR_<IDENTIFIER>_="<string>"
set MINIO_NOTIFY_WEBHOOK_QUEUE_LIMIT_<IDENTIFIER>_="<string>"
set MINIO_NOTIFY_WEBHOOK_CLIENT_CERT_<IDENTIFIER>_="<string>"
set MINIO_NOTIFY_WEBHOOK_CLIENT_KEY_<IDENTIFIER>_="<string>"
set MINIO_NOTIFY_WEBHOOK_COMMENT_<IDENTIFIER>_="<string>"
- 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 of ``PRIMARY``.
If the specified ``<IDENTIFIER>`` matches an existing Webhook service
endpoint on the MinIO deployment, the new settings *override*
any existing settings for that endpoint. Use
:mc-cmd:`mc admin config get notify_webhook <mc admin config get>` to
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 :ref:`Webhook Service for Bucket Notifications
<minio-server-envvar-bucket-notification-webhook>` for complete documentation
on each environment variable.
.. tab:: Configuration Settings
MinIO supports adding or updating Webhook endpoints on a running
:mc:`minio server` process using the :mc-cmd:`mc admin config set` command
and the :mc-conf:`notify_webhook` configuration key. You must restart the
:mc:`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
:mc-conf:`notify_webhook endpoint <notify_webhook.endpoint>`:
.. code-block:: shell
:class: copyable
mc admin config set ALIAS/ notify_webhook:IDENTIFIER \
endpoint="<ENDPOINT>" \
auth_token="<string>" \
queue_dir="<string>" \
queue_limit="<string>" \
client_cert="<string>" \
client_key="<string>" \
comment="<string>"
- Replace ``IDENTIFIER`` with a unique descriptive string for the
Webhook service endpoint. The following examples in this procedure
assume an identifier of ``PRIMARY``.
If the specified ``IDENTIFIER`` matches an existing Webhook service
endpoint on the MinIO deployment, the new settings *override*
any existing settings for that endpoint. Use
:mc-cmd:`mc admin config get notify_webhook <mc admin config get>` to
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 :ref:`Webhook Bucket Notification Configuration Settings
<minio-server-config-bucket-notification-webhook>` for complete
documentation on each setting.
2) Restart the MinIO Deployment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You must restart the MinIO deployment to apply the configuration changes.
Use the :mc-cmd:`mc admin service restart` command to restart the deployment.
.. important::
MinIO restarts *all* :mc:`minio server` processes associated to the
deployment at the same time. Applications may experience a brief period of
downtime during the restart process.
Consider scheduling the restart during a maintenance period to minimize
interruption of services.
.. code-block:: shell
:class: copyable
mc admin service restart ALIAS
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the deployment to
restart.
The :mc:`minio server` process prints a line on startup for each configured
Webhook target similar to the following:
.. code-block:: shell
SQS ARNs: arn:minio:sqs::primary:webhook
You must specify the ARN resource when configuring bucket notifications with
the associated Webhook deployment as a target.
3) Configure Bucket Notifications using the Webhook Endpoint as a Target
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the :mc-cmd:`mc event add` command to add a new bucket notification
event with the configured Webhook service as a target:
.. code-block:: shell
:class: copyable
mc event add ALIAS/BUCKET arn:minio:sqs::primary:webhook \
--event EVENTS
- Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of a MinIO deployment.
- Replace ``BUCKET`` with the name of the bucket in which to configure the
event.
- Replace ``EVENTS`` with a comma-separated list of :ref:`events
<mc-event-supported-events>` for which MinIO triggers notifications.
Use :mc-cmd:`mc event list` to view all configured bucket events for
a given notification target:
.. code-block:: shell
:class: copyable
mc event list ALIAS/BUCKET arn:minio:sqs::primary:webhook
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 :mc-cmd:`events <mc-event-add-event>` 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-cmd:`mc cp` command to create a new object in the bucket and trigger
a notification.
.. code-block:: shell
:class: copyable
mc cp ~/data/new-object.txt ALIAS/BUCKET
Update an Webhook Endpoint in a MinIO Deployment
------------------------------------------------
The following procedure updates an existing Webhook service endpoint for supporting
:ref:`bucket notifications <minio-bucket-notifications>` in a MinIO
deployment.
.. include:: /includes/common-admonitions.rst
:start-after: start-restart-downtime
:end-before: end-restart-downtime
Prerequisites
~~~~~~~~~~~~~~
MinIO ``mc`` Command Line Tool
++++++++++++++++++++++++++++++
This procedure uses the :mc:`mc` command line tool for certain actions.
See the ``mc`` :ref:`Quickstart <mc-install>` for installation instructions.
1) List Configured Webhook Endpoints In The Deployment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the :mc-cmd:`mc admin config get` command to list the currently
configured Webhook service endpoints in the deployment:
.. code-block:: shell
:class: copyable
mc admin config get ALIAS/ notify_webhook
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the MinIO deployment.
The command output resembles the following:
.. code-block:: shell
notify_webhook:primary endpoint="https://webhook.example.com" auth_token="" queue_limit="0" queue_dir="" client_cert="" client_key=""
notify_webhook:secondary endpoint="https://webhook.example.com" auth_token="" queue_limit="0" queue_dir="" client_cert="" client_key=""
The :mc-conf:`notify_webhook` key is the top-level configuration key for an
:ref:`minio-server-config-bucket-notification-webhook`. The
:mc-conf:`endpoint <notify_webhook.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-cmd:`mc admin config set` command to set the new configuration
for the Webhook service endpoint:
.. code-block:: shell
:class: copyable
mc admin config set ALIAS/ notify_webhook:IDENTIFIER \
endpoint="<ENDPOINT>" \
auth_token="<string>" \
queue_dir="<string>" \
queue_limit="<string>" \
client_cert="<string>" \
client_key="<string>" \
comment="<string>"
The :mc-conf:`notify_webhook endpoint <notify_webhook.endpoint>` configuration
setting is the *minimum* required for an Webhook service endpoint. All other
configuration settings are *optional*. See
:ref:`minio-server-config-bucket-notification-webhook` 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-cmd:`mc admin service restart` command to restart the deployment.
.. important::
MinIO restarts *all* :mc:`minio server` processes associated to the
deployment at the same time. Applications may experience a brief period of
downtime during the restart process.
Consider scheduling the restart during a maintenance period to minimize
interruption of services.
.. code-block:: shell
:class: copyable
mc admin service restart ALIAS
Replace ``ALIAS`` with the :mc:`alias <mc-alias>` of the deployment to
restart.
The :mc:`minio server` process prints a line on startup for each configured Webhook
target similar to the following:
.. code-block:: shell
SQS ARNs: arn:minio:sqs::primary:webhook
3) 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 :mc-cmd:`events <mc-event-add-event>`
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-cmd:`mc cp` command to create a new object in the bucket and trigger
a notification.
.. code-block:: shell
:class: copyable
mc cp ~/data/new-object.txt ALIAS/BUCKET

View File

@ -0,0 +1,36 @@
==========
Monitoring
==========
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 1
Bucket Notifications
--------------------
MinIO supports publishing bucket or object events to the following supported
targets on certain supported events.
- :ref:`minio-bucket-notifications-publish-amqp`
- :ref:`minio-bucket-notifications-publish-mqtt`
- :ref:`minio-bucket-notifications-publish-nats`
- :ref:`minio-bucket-notifications-publish-nsq`
- :ref:`minio-bucket-notifications-publish-elasticsearch`
- :ref:`minio-bucket-notifications-publish-kafka`
- :ref:`minio-bucket-notifications-publish-mysql`
- :ref:`minio-bucket-notifications-publish-postgresql`
- :ref:`minio-bucket-notifications-publish-redis`
- :ref:`minio-bucket-notifications-publish-webhook`
See :ref:`minio-bucket-notifications`
for more complete documentation on MinIO Bucket Notifications.
.. toctree::
:titlesonly:
:hidden:
/monitoring/bucket-notifications/bucket-notifications

File diff suppressed because it is too large Load Diff

View File

@ -19,10 +19,10 @@ The :mc:`mc event` command supports adding, removing, and listing
the bucket event notifications.
MinIO automatically sends triggered events to the configured notification
targets. MinIO supports notification targets like AMQP, Redis, ElasticSearch,
NATS and PostgreSQL. See
:doc:`MinIO Bucket Notifications </concepts/bucket-notifications>`
for more information.
targets. MinIO supports notification targets like AMQP (RabbitMQ), Redis,
ElasticSearch, NATS and PostgreSQL. See
:doc:`MinIO Bucket Notifications </monitoring/bucket-notifications/bucket-notifications>` for more
information.
.. end-mc-event-desc
@ -31,37 +31,30 @@ for more information.
Supported Bucket Events
~~~~~~~~~~~~~~~~~~~~~~~
The following table lists the supported S3 Event and the corresponding
:mc:`mc event` alias:
MinIO supports the following S3 event types:
.. list-table::
:header-rows: 1
:widths: 20 80
:width: 100%
* - MinIO Alias
- Corresponding S3 Event
* - ``put``
- ``s3:ObjectCreated:Put``
* - ``completeMultipartUpload``
- ``s3:ObjectCreated:CompleteMultipartUpload``
* - ``head``
- ``s3:ObjectAccessed:Head``
* - ``post``
- ``s3:ObjectCreated:Post``
* - ``delete``
- ``s3:ObjectRemoved:Delete``
* - ``copy``
- ``s3:ObjectCreated:Copy``
* - ``get``
- ``s3:ObjectAccessed:Get``
- :data:`s3:ObjectRemoved:DeleteMarkerCreated`
- :data:`s3:ObjectRemoved:Delete`
- :data:`s3:ObjectCreated:PutRetention`
- :data:`s3:ObjectCreated:PutLegalHold`
- :data:`s3:ObjectCreated:Put`
- :data:`s3:ObjectCreated:Post`
- :data:`s3:ObjectCreated:Copy`
- :data:`s3:ObjectCreated:CompleteMultipartUpload`
- :data:`s3:ObjectAccessed:Head`
- :data:`s3:ObjectAccessed:GetRetention`
- :data:`s3:ObjectAccessed:GetLegalHold`
- :data:`s3:ObjectAccessed:Get`
- :data:`s3:Replication:OperationCompletedReplication`
- :data:`s3:Replication:OperationFailedReplication`
- :data:`s3:Replication:OperationMissedThreshold`
- :data:`s3:Replication:OperationNotTracked`
- :data:`s3:Replication:OperationReplicatedAfterThreshold`
- :data:`s3:ObjectRestore:Post`
- :data:`s3:ObjectRestore:Completed`
- :data:`s3:BucketCreated`
- :data:`s3:BucketRemoved`
For more complete documentation on the listed S3 events, see
:s3-docs:`S3 Supported Event Types
@ -171,7 +164,7 @@ Syntax
The MinIO server outputs an ARN for each configured
notification target at server startup. See
:doc:`/concepts/bucket-notifications` for more
:doc:`/monitoring/bucket-notifications/bucket-notifications` for more
information.
.. mc-cmd:: event
@ -232,7 +225,7 @@ Syntax
The MinIO server outputs an ARN for each configured
notification target at server startup. See
:doc:`/concepts/bucket-notifications` for more information.
:doc:`/monitoring/bucket-notifications/bucket-notifications` for more information.
.. mc-cmd:: force
:option:
@ -302,7 +295,7 @@ Syntax
The MinIO server outputs an ARN for each configured
notification target at server startup. See
:doc:`/concepts/bucket-notifications` for more information.
:doc:`/monitoring/bucket-notifications/bucket-notifications` for more information.

View File

@ -0,0 +1,101 @@
=============
MinIO Gateway
=============
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
.. _minio-gateway:
MinIO Gateway
-------------
Syntax
~~~~~~
.. mc:: minio gateway
Starts the MinIO Gateway process.
The command has the following syntax:
.. code-block:: shell
:class: copyable
minio gateway [FLAGS] SUBCOMMAND [ARGUMENTS]
:mc:`minio gateway` supports the following flags:
.. mc-cmd:: address
:option:
*Optional* Binds the MinIO Gateway to a specific network address and port
number. Specify the address and port as ``ADDRESS:PORT``, where ``ADDRESS``
is an IP address or hostname and ``PORT`` is a valid and open port on the
host system.
To change the port number for all IP addresses or hostnames configured
on the host machine, specify ``:PORT`` where ``PORT`` is a valid
and open port on the host.
.. mc-cmd:: certs-dir, -S
:option:
*Optional* Specifies the path to the folder containing certificates the
MinIO Gateway process uses for configuring TLS/SSL connectivity.
Omit to use the default directory paths:
- Linux/OSX: ``${HOME}/.minio/certs``
- Windows: ``%%USERPROFILE%%\.minio\certs``.
See :ref:`minio-TLS` for more information on TLS/SSL connectivity.
.. mc-cmd:: quiet
:option:
*Optional* Disables startup information.
.. mc-cmd:: anonymous
:option:
*Optional* Hides sensitive information from logging.
.. mc-cmd:: json
:option:
*Optional* Outputs server logs and startup information in ``JSON``
format.
:mc:`minio gateway` supports the following subcommands:
.. mc-cmd:: nas
:fullpath:
Creates a MinIO Gateway process configured for Network-Attached Storage
(NAS).
.. mc-cmd:: azure
:fullpath:
Creates a MinIO Gateway process configured for Microsoft Azure Blob Storage.
.. mc-cmd:: s3
:fullpath:
Creates a MinIO Gateway process configured for Amazon Simple Storage Service
(S3).
.. mc-cmd:: hdfs
:fullpath:
Creates a MinIO Gateway process configured for Hadoop Distributed File
System (HDFS).
.. mc-cmd:: gcs
:fullpath:
Creates a MinIO Gateway process configured for Google Cloud Storage.

File diff suppressed because it is too large Load Diff

View File

@ -268,6 +268,8 @@ class MinioObject(ObjectDescription):
option_spec = {
'noindex': directives.flag,
'noindexentry': directives.flag,
'noprefix': directives.flag,
'delimiter': directives.unchanged,
}
def handle_signature(self, sig: str, signode: desc_signature) -> Tuple[str, str]:
@ -279,6 +281,13 @@ class MinioObject(ObjectDescription):
"""
sig = sig.strip()
noprefix = 'noprefix' in self.options
if ('delimiter' in self.options):
delimiter = self.options.get('delimiter').strip('"')
else:
delimiter = "."
member = sig
# If construct is nested, prefix the current prefix
prefix = self.env.ref_context.get('minio:object', None)
@ -291,8 +300,9 @@ class MinioObject(ObjectDescription):
signode['object'] = prefix
signode['fullname'] = fullname
if prefix:
signode += addnodes.desc_addname(prefix + '.', prefix + '.')
if prefix and (noprefix == False):
# signode += addnodes.desc_addname(prefix + '.', prefix + '.')
signode += addnodes.desc_addname(prefix + delimiter, prefix + delimiter)
signode += addnodes.desc_name(member, member)
@ -480,7 +490,8 @@ class MinIODomain(Domain):
'mc-cmd': ObjType(_('mc-cmd'), 'mc-cmd'),
'mc-cmd-option': ObjType(_('mc-cmd-option'), 'mc-cmd-option'),
'policy-action': ObjType(_('policy-action'), 'policy-action'),
'envvar': ObjType(_('envvar'), 'envvar')
'envvar': ObjType(_('envvar'), 'envvar'),
'mc-conf': ObjType(_('mc-conf'), 'mc-conf')
}
directives = {
'data': MinioObject,
@ -490,7 +501,8 @@ class MinIODomain(Domain):
'mc': MinioMCCommand,
'mc-cmd': MinioMCObject,
'policy-action': MinioObject,
'envvar': MinioObject
'envvar': MinioObject,
'mc-conf': MinioObject,
}
roles = {
'data': MinioXRefRole(),
@ -502,6 +514,7 @@ class MinIODomain(Domain):
'mc-cmd-option': MinioCMDOptionXRefRole(),
'policy-action': MinioXRefRole(),
'envvar': MinioXRefRole(),
'mc-conf': MinioXRefRole(),
}
initial_data = {