mirror of
https://github.com/minio/minio.git
synced 2025-04-07 21:25:36 -04:00
docs: Move the notifications into docs/bucket
Cleanup some formatting issues.
This commit is contained in:
parent
4dea4f3b89
commit
cd80e6df29
@ -1,33 +1,31 @@
|
||||
[](https://slack.minio.io)
|
||||
# Minio Bucket Notification Reference Guide [](https://slack.minio.io)
|
||||
|
||||
Minio server supports Amazon S3 compatible bucket event notification for the following targets [AMQP](https://www.amqp.org/about/what), [Elasticsearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started.html) , [Redis](http://redis.io/documentation), [nats.io](http://nats.io/), [PostgreSQL](https://www.postgresql.org) and [kafka](https://kafka.apache.org/).
|
||||
Minio server supports Amazon S3 compatible bucket event notification for the following targets
|
||||
|
||||
| Notification Targets|
|
||||
|:---|
|
||||
| [`AMQP`](#AMQP) |
|
||||
| [`Elasticsearch`](#Elasticsearch) |
|
||||
| [`Redis`](#Redis) |
|
||||
| [`NATS`](#NATS) |
|
||||
| [`PostgreSQL`](#PostgreSQL) |
|
||||
| [`Apache Kafka`](#apache-kafka) |
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* Install and configure Minio Server from [here](http://docs.minio.io/docs/minio).
|
||||
* Install and configure Minio Client from [here](https://docs.minio.io/docs/minio-client-quickstart-guide).
|
||||
|
||||
| Notification Targets|
|
||||
|:--
|
||||
| [`RabbitMQ`](#RabbitMQ) |
|
||||
| [`Elasticsearch`](#Elasticsearch) |
|
||||
| [`Redis`](#Redis) |
|
||||
| [`NATS`](#NATS) |
|
||||
| [`PostgreSQL`](#PostgreSQL) |
|
||||
| [`kafka`](#kafka) |
|
||||
|
||||
<a name="RabbitMQ"></a>
|
||||
## Publish Minio events via RabbitMQ
|
||||
<a name="AMQP"></a>
|
||||
## Publish Minio events via AMQP
|
||||
|
||||
Install RabbitMQ from [here](https://www.rabbitmq.com/).
|
||||
|
||||
### Recipe steps
|
||||
### Step 1: Add AMQP endpoint to Minio
|
||||
|
||||
### Step 1: Add RabbitMQ endpoint to Minio
|
||||
The default location of Minio server configuration file is ``~/.minio/config.json``. Update the AMQP configuration block in ``config.json`` as follows:
|
||||
|
||||
The default location of Minio server configuration file is ``~/.minio/config.json``. Update the RabbitMQ configuration block in ``config.json`` as follows:
|
||||
|
||||
```
|
||||
```json
|
||||
"amqp": {
|
||||
"1": {
|
||||
"enable": true,
|
||||
@ -42,9 +40,10 @@ The default location of Minio server configuration file is ``~/.minio/config.jso
|
||||
"noWait": false,
|
||||
"autoDeleted": false
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
Restart Minio server to reflect config changes. Minio supports all the exchange available in [RabbitMQ](https://www.rabbitmq.com/). For this setup, we are using ``fanout`` exchange.
|
||||
|
||||
Restart Minio server to reflect config changes. Minio supports all the exchanges available in [RabbitMQ](https://www.rabbitmq.com/). For this setup, we are using ``fanout`` exchange.
|
||||
|
||||
### Step 2: Enable bucket notification using Minio client
|
||||
|
||||
@ -108,6 +107,7 @@ You should receive the following event notification via RabbitMQ once the upload
|
||||
python rabbit.py
|
||||
‘{“Records”:[{“eventVersion”:”2.0",”eventSource”:”aws:s3",”awsRegion”:”us-east-1",”eventTime”:”2016–09–08T22:34:38.226Z”,”eventName”:”s3:ObjectCreated:Put”,”userIdentity”:{“principalId”:”minio”},”requestParameters”:{“sourceIPAddress”:”10.1.10.150:44576"},”responseElements”:{},”s3":{“s3SchemaVersion”:”1.0",”configurationId”:”Config”,”bucket”:{“name”:”images”,”ownerIdentity”:{“principalId”:”minio”},”arn”:”arn:aws:s3:::images”},”object”:{“key”:”myphoto.jpg”,”size”:200436,”sequencer”:”147279EAF9F40933"}}}],”level”:”info”,”msg”:””,”time”:”2016–09–08T15:34:38–07:00"}\n
|
||||
```
|
||||
|
||||
<a name="Elasticsearch"></a>
|
||||
## Publish Minio events via Elasticsearch
|
||||
|
||||
@ -119,15 +119,16 @@ Install Elasticsearch 2.4 from [here](https://www.elastic.co/downloads/past-rele
|
||||
|
||||
The default location of Minio server configuration file is ``~/.minio/config.json``. Update the Elasticsearch configuration block in ``config.json`` as follows:
|
||||
|
||||
```
|
||||
```json
|
||||
"elasticsearch": {
|
||||
"1": {
|
||||
"enable": true,
|
||||
"url": "http://127.0.0.1:9200",
|
||||
"index": "bucketevents"
|
||||
}
|
||||
},
|
||||
},
|
||||
```
|
||||
|
||||
Restart Minio server to reflect config changes. ``bucketevents`` is the index used by Elasticsearch.
|
||||
|
||||
### Step 2: Enable bucket notification using Minio client
|
||||
@ -213,6 +214,7 @@ curl -XGET '127.0.0.1:9200/bucketevents/_search?pretty=1'
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
``curl`` output above states that an Elasticsearch index has been successfully created with notification contents.
|
||||
|
||||
<a name="Redis"></a>
|
||||
@ -220,13 +222,11 @@ curl -XGET '127.0.0.1:9200/bucketevents/_search?pretty=1'
|
||||
|
||||
Install Redis from [here](http://redis.io/download).
|
||||
|
||||
## Recipe steps
|
||||
|
||||
### Step 1: Add Redis endpoint to Minio
|
||||
|
||||
The default location of Minio server configuration file is ``~/.minio/config.json``. Update the Redis configuration block in ``config.json`` as follows:
|
||||
|
||||
```
|
||||
```json
|
||||
"redis": {
|
||||
"1": {
|
||||
"enable": true,
|
||||
@ -234,8 +234,9 @@ The default location of Minio server configuration file is ``~/.minio/config.jso
|
||||
"password": "yoursecret",
|
||||
"key": "bucketevents"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Restart Minio server to reflect config changes. ``bucketevents`` is the key used by Redis in this example.
|
||||
|
||||
### Step 2: Enable bucket notification using Minio client
|
||||
@ -272,13 +273,12 @@ OK
|
||||
1474321638.556108 [0 127.0.0.1:40190] "AUTH" "yoursecret"
|
||||
1474321638.556477 [0 127.0.0.1:40190] "RPUSH" "bucketevents" "{\"Records\":[{\"eventVersion\":\"2.0\",\"eventSource\":\"aws:s3\",\"awsRegion\":\"us-east-1\",\"eventTime\":\"2016-09-19T21:47:18.555Z\",\"eventName\":\"s3:ObjectCreated:Put\",\"userIdentity\":{\"principalId\":\"minio\"},\"requestParameters\":{\"sourceIPAddress\":\"[::1]:39250\"},\"responseElements\":{},\"s3\":{\"s3SchemaVersion\":\"1.0\",\"configurationId\":\"Config\",\"bucket\":{\"name\":\"images\",\"ownerIdentity\":{\"principalId\":\"minio\"},\"arn\":\"arn:aws:s3:::images\"},\"object\":{\"key\":\"myphoto.jpg\",\"size\":23745,\"sequencer\":\"1475D7B80ECBD853\"}}}],\"level\":\"info\",\"msg\":\"\",\"time\":\"2016-09-19T14:47:18-07:00\"}\n"
|
||||
```
|
||||
|
||||
<a name="NATS"></a>
|
||||
## Publish Minio events via NATS
|
||||
|
||||
Install NATS from [here](http://nats.io/).
|
||||
|
||||
## Recipe steps
|
||||
|
||||
### Step 1: Add NATS endpoint to Minio
|
||||
|
||||
The default location of Minio server configuration file is ``~/.minio/config.json``. Update the NATS configuration block in ``config.json`` as follows:
|
||||
@ -295,8 +295,9 @@ The default location of Minio server configuration file is ``~/.minio/config.jso
|
||||
"secure": false,
|
||||
"pingInterval": 0
|
||||
}
|
||||
},
|
||||
},
|
||||
```
|
||||
|
||||
Restart Minio server to reflect config changes. ``bucketevents`` is the subject used by NATS in this example.
|
||||
|
||||
### Step 2: Enable bucket notification using Minio client
|
||||
@ -319,8 +320,9 @@ package main
|
||||
|
||||
// Import Go and NATS packages
|
||||
import (
|
||||
"runtime"
|
||||
"log"
|
||||
"runtime"
|
||||
|
||||
"github.com/nats-io/nats"
|
||||
)
|
||||
|
||||
@ -335,7 +337,7 @@ func main() {
|
||||
natsConnection.Subscribe("bucketevents", func(msg *nats.Msg) {
|
||||
|
||||
// Handle the message
|
||||
log.Printf("Received message '%s\n", string(msg.Data) + "'")
|
||||
log.Printf("Received message '%s\n", string(msg.Data)+"'")
|
||||
})
|
||||
|
||||
// Keep the connection alive
|
||||
@ -369,8 +371,6 @@ go run nats.go
|
||||
|
||||
Install PostgreSQL from [here](https://www.postgresql.org/).
|
||||
|
||||
## Recipe steps
|
||||
|
||||
### Step 1: Add PostgreSQL endpoint to Minio
|
||||
|
||||
The default location of Minio server configuration file is ``~/.minio/config.json``. Update the PostgreSQL configuration block in ``config.json`` as follows:
|
||||
@ -387,8 +387,9 @@ The default location of Minio server configuration file is ``~/.minio/config.jso
|
||||
"password": "mypassword",
|
||||
"database": "bucketevents_db"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Restart Minio server to reflect config changes. ``bucketevents`` is the database table used by PostgreSQL in this example.
|
||||
|
||||
### Step 2: Enable bucket notification using Minio client
|
||||
@ -421,13 +422,11 @@ key | value
|
||||
(1 row)
|
||||
```
|
||||
|
||||
<a name="kafka"></a>
|
||||
<a name="apache-kafka"></a>
|
||||
## Publish Minio events via kafka
|
||||
|
||||
Install kafka from [here](http://kafka.apache.org/).
|
||||
|
||||
## Recipe steps
|
||||
|
||||
### Step 1: Add kafka endpoint to Minio
|
||||
|
||||
The default location of Minio server configuration file is ``~/.minio/config.json``. Update the kafka configuration block in ``config.json`` as follows:
|
||||
@ -441,6 +440,7 @@ The default location of Minio server configuration file is ``~/.minio/config.jso
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Restart Minio server to reflect config changes. ``bucketevents`` is the topic used by kafka in this example.
|
||||
|
||||
### Step 2: Enable bucket notification using Minio client
|
Loading…
x
Reference in New Issue
Block a user