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,50 +1,49 @@
|
|||||||
[](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
|
||||||
|
|
||||||
## Prerequisites
|
| 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 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).
|
* Install and configure Minio Client from [here](https://docs.minio.io/docs/minio-client-quickstart-guide).
|
||||||
|
|
||||||
| Notification Targets|
|
<a name="AMQP"></a>
|
||||||
|:--
|
## Publish Minio events via AMQP
|
||||||
| [`RabbitMQ`](#RabbitMQ) |
|
|
||||||
| [`Elasticsearch`](#Elasticsearch) |
|
|
||||||
| [`Redis`](#Redis) |
|
|
||||||
| [`NATS`](#NATS) |
|
|
||||||
| [`PostgreSQL`](#PostgreSQL) |
|
|
||||||
| [`kafka`](#kafka) |
|
|
||||||
|
|
||||||
<a name="RabbitMQ"></a>
|
|
||||||
## Publish Minio events via RabbitMQ
|
|
||||||
|
|
||||||
Install RabbitMQ from [here](https://www.rabbitmq.com/).
|
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": {
|
"amqp": {
|
||||||
"1": {
|
"1": {
|
||||||
"enable": true,
|
"enable": true,
|
||||||
"url": "amqp://myuser:mypassword@localhost:5672",
|
"url": "amqp://myuser:mypassword@localhost:5672",
|
||||||
"exchange": "bucketevents",
|
"exchange": "bucketevents",
|
||||||
"routingKey": "bucketlogs",
|
"routingKey": "bucketlogs",
|
||||||
"exchangeType": "fanout",
|
"exchangeType": "fanout",
|
||||||
"mandatory": false,
|
"mandatory": false,
|
||||||
"immediate": false,
|
"immediate": false,
|
||||||
"durable": false,
|
"durable": false,
|
||||||
"internal": false,
|
"internal": false,
|
||||||
"noWait": false,
|
"noWait": false,
|
||||||
"autoDeleted": 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
|
### Step 2: Enable bucket notification using Minio client
|
||||||
|
|
||||||
@ -52,14 +51,14 @@ We will enable bucket event notification to trigger whenever a JPEG image is upl
|
|||||||
|
|
||||||
```
|
```
|
||||||
mc mb myminio/images
|
mc mb myminio/images
|
||||||
mc events add myminio/images arn:minio:sqs:us-east-1:1:amqp --suffix .jpg
|
mc events add myminio/images arn:minio:sqs:us-east-1:1:amqp --suffix .jpg
|
||||||
mc events list myminio/images
|
mc events list myminio/images
|
||||||
arn:minio:sqs:us-east-1:1:amqp s3:ObjectCreated:*,s3:ObjectRemoved:* Filter: suffix=”.jpg”
|
arn:minio:sqs:us-east-1:1:amqp s3:ObjectCreated:*,s3:ObjectRemoved:* Filter: suffix=”.jpg”
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step 3: Test on RabbitMQ
|
### Step 3: Test on RabbitMQ
|
||||||
|
|
||||||
The python program below waits on the queue exchange ``bucketevents`` and prints event notifications on the console. We use [Pika Python Client](https://www.rabbitmq.com/tutorials/tutorial-three-python.html) library to do this.
|
The python program below waits on the queue exchange ``bucketevents`` and prints event notifications on the console. We use [Pika Python Client](https://www.rabbitmq.com/tutorials/tutorial-three-python.html) library to do this.
|
||||||
|
|
||||||
```py
|
```py
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
@ -108,8 +107,9 @@ You should receive the following event notification via RabbitMQ once the upload
|
|||||||
python rabbit.py
|
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
|
‘{“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>
|
<a name="Elasticsearch"></a>
|
||||||
## Publish Minio events via Elasticsearch
|
## Publish Minio events via Elasticsearch
|
||||||
|
|
||||||
Install Elasticsearch 2.4 from [here](https://www.elastic.co/downloads/past-releases/elasticsearch-2-4-0).
|
Install Elasticsearch 2.4 from [here](https://www.elastic.co/downloads/past-releases/elasticsearch-2-4-0).
|
||||||
|
|
||||||
@ -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:
|
The default location of Minio server configuration file is ``~/.minio/config.json``. Update the Elasticsearch configuration block in ``config.json`` as follows:
|
||||||
|
|
||||||
```
|
```json
|
||||||
"elasticsearch": {
|
"elasticsearch": {
|
||||||
"1": {
|
"1": {
|
||||||
"enable": true,
|
"enable": true,
|
||||||
"url": "http://127.0.0.1:9200",
|
"url": "http://127.0.0.1:9200",
|
||||||
"index": "bucketevents"
|
"index": "bucketevents"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
```
|
```
|
||||||
|
|
||||||
Restart Minio server to reflect config changes. ``bucketevents`` is the index used by Elasticsearch.
|
Restart Minio server to reflect config changes. ``bucketevents`` is the index used by Elasticsearch.
|
||||||
|
|
||||||
### Step 2: Enable bucket notification using Minio client
|
### 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.
|
``curl`` output above states that an Elasticsearch index has been successfully created with notification contents.
|
||||||
|
|
||||||
<a name="Redis"></a>
|
<a name="Redis"></a>
|
||||||
@ -220,22 +222,21 @@ curl -XGET '127.0.0.1:9200/bucketevents/_search?pretty=1'
|
|||||||
|
|
||||||
Install Redis from [here](http://redis.io/download).
|
Install Redis from [here](http://redis.io/download).
|
||||||
|
|
||||||
## Recipe steps
|
|
||||||
|
|
||||||
### Step 1: Add Redis endpoint to Minio
|
### 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:
|
The default location of Minio server configuration file is ``~/.minio/config.json``. Update the Redis configuration block in ``config.json`` as follows:
|
||||||
|
|
||||||
```
|
```json
|
||||||
"redis": {
|
"redis": {
|
||||||
"1": {
|
"1": {
|
||||||
"enable": true,
|
"enable": true,
|
||||||
"address": "127.0.0.1:6379",
|
"address": "127.0.0.1:6379",
|
||||||
"password": "yoursecret",
|
"password": "yoursecret",
|
||||||
"key": "bucketevents"
|
"key": "bucketevents"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Restart Minio server to reflect config changes. ``bucketevents`` is the key used by Redis in this example.
|
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
|
### Step 2: Enable bucket notification using Minio client
|
||||||
@ -272,12 +273,11 @@ OK
|
|||||||
1474321638.556108 [0 127.0.0.1:40190] "AUTH" "yoursecret"
|
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"
|
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>
|
<a name="NATS"></a>
|
||||||
## Publish Minio events via NATS
|
## Publish Minio events via NATS
|
||||||
|
|
||||||
Install NATS from [here](http://nats.io/).
|
Install NATS from [here](http://nats.io/).
|
||||||
|
|
||||||
## Recipe steps
|
|
||||||
|
|
||||||
### Step 1: Add NATS endpoint to Minio
|
### Step 1: Add NATS endpoint to Minio
|
||||||
|
|
||||||
@ -285,18 +285,19 @@ The default location of Minio server configuration file is ``~/.minio/config.jso
|
|||||||
|
|
||||||
```
|
```
|
||||||
"nats": {
|
"nats": {
|
||||||
"1": {
|
"1": {
|
||||||
"enable": true,
|
"enable": true,
|
||||||
"address": "0.0.0.0:4222",
|
"address": "0.0.0.0:4222",
|
||||||
"subject": "bucketevents",
|
"subject": "bucketevents",
|
||||||
"username": "yourusername",
|
"username": "yourusername",
|
||||||
"password": "yoursecret",
|
"password": "yoursecret",
|
||||||
"token": "",
|
"token": "",
|
||||||
"secure": false,
|
"secure": false,
|
||||||
"pingInterval": 0
|
"pingInterval": 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
```
|
```
|
||||||
|
|
||||||
Restart Minio server to reflect config changes. ``bucketevents`` is the subject used by NATS in this example.
|
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
|
### Step 2: Enable bucket notification using Minio client
|
||||||
@ -319,27 +320,28 @@ package main
|
|||||||
|
|
||||||
// Import Go and NATS packages
|
// Import Go and NATS packages
|
||||||
import (
|
import (
|
||||||
"runtime"
|
"log"
|
||||||
"log"
|
"runtime"
|
||||||
"github.com/nats-io/nats"
|
|
||||||
|
"github.com/nats-io/nats"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
// Create server connection
|
// Create server connection
|
||||||
natsConnection, _ := nats.Connect("nats://yourusername:yoursecret@localhost:4222")
|
natsConnection, _ := nats.Connect("nats://yourusername:yoursecret@localhost:4222")
|
||||||
log.Println("Connected")
|
log.Println("Connected")
|
||||||
|
|
||||||
// Subscribe to subject
|
// Subscribe to subject
|
||||||
log.Printf("Subscribing to subject 'bucketevents'\n")
|
log.Printf("Subscribing to subject 'bucketevents'\n")
|
||||||
natsConnection.Subscribe("bucketevents", func(msg *nats.Msg) {
|
natsConnection.Subscribe("bucketevents", func(msg *nats.Msg) {
|
||||||
|
|
||||||
// Handle the message
|
// 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
|
// Keep the connection alive
|
||||||
runtime.Goexit()
|
runtime.Goexit()
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -358,7 +360,7 @@ mc cp myphoto.jpg myminio/images
|
|||||||
The example ``nats.go`` program prints event notification to console.
|
The example ``nats.go`` program prints event notification to console.
|
||||||
|
|
||||||
```
|
```
|
||||||
go run nats.go
|
go run nats.go
|
||||||
2016/10/12 06:51:26 Connected
|
2016/10/12 06:51:26 Connected
|
||||||
2016/10/12 06:51:26 Subscribing to subject 'bucketevents'
|
2016/10/12 06:51:26 Subscribing to subject 'bucketevents'
|
||||||
2016/10/12 06:51:33 Received message '{"EventType":"s3:ObjectCreated:Put","Key":"images/myphoto.jpg","Records":[{"eventVersion":"2.0","eventSource":"aws:s3","awsRegion":"us-east-1","eventTime":"2016-10-12T13:51:33Z","eventName":"s3:ObjectCreated:Put","userIdentity":{"principalId":"minio"},"requestParameters":{"sourceIPAddress":"[::1]:57106"},"responseElements":{},"s3":{"s3SchemaVersion":"1.0","configurationId":"Config","bucket":{"name":"images","ownerIdentity":{"principalId":"minio"},"arn":"arn:aws:s3:::images"},"object":{"key":"myphoto.jpg","size":56060,"eTag":"1d97bf45ecb37f7a7b699418070df08f","sequencer":"147CCD1AE054BFD0"}}}],"level":"info","msg":"","time":"2016-10-12T06:51:33-07:00"}
|
2016/10/12 06:51:33 Received message '{"EventType":"s3:ObjectCreated:Put","Key":"images/myphoto.jpg","Records":[{"eventVersion":"2.0","eventSource":"aws:s3","awsRegion":"us-east-1","eventTime":"2016-10-12T13:51:33Z","eventName":"s3:ObjectCreated:Put","userIdentity":{"principalId":"minio"},"requestParameters":{"sourceIPAddress":"[::1]:57106"},"responseElements":{},"s3":{"s3SchemaVersion":"1.0","configurationId":"Config","bucket":{"name":"images","ownerIdentity":{"principalId":"minio"},"arn":"arn:aws:s3:::images"},"object":{"key":"myphoto.jpg","size":56060,"eTag":"1d97bf45ecb37f7a7b699418070df08f","sequencer":"147CCD1AE054BFD0"}}}],"level":"info","msg":"","time":"2016-10-12T06:51:33-07:00"}
|
||||||
@ -369,26 +371,25 @@ go run nats.go
|
|||||||
|
|
||||||
Install PostgreSQL from [here](https://www.postgresql.org/).
|
Install PostgreSQL from [here](https://www.postgresql.org/).
|
||||||
|
|
||||||
## Recipe steps
|
|
||||||
|
|
||||||
### Step 1: Add PostgreSQL endpoint to Minio
|
### 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:
|
The default location of Minio server configuration file is ``~/.minio/config.json``. Update the PostgreSQL configuration block in ``config.json`` as follows:
|
||||||
|
|
||||||
```
|
```
|
||||||
"postgresql": {
|
"postgresql": {
|
||||||
"1": {
|
"1": {
|
||||||
"enable": true,
|
"enable": true,
|
||||||
"connectionString": "",
|
"connectionString": "",
|
||||||
"table": "bucketevents",
|
"table": "bucketevents",
|
||||||
"host": "127.0.0.1",
|
"host": "127.0.0.1",
|
||||||
"port": "5432",
|
"port": "5432",
|
||||||
"user": "postgres",
|
"user": "postgres",
|
||||||
"password": "mypassword",
|
"password": "mypassword",
|
||||||
"database": "bucketevents_db"
|
"database": "bucketevents_db"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Restart Minio server to reflect config changes. ``bucketevents`` is the database table used by PostgreSQL in this example.
|
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
|
### Step 2: Enable bucket notification using Minio client
|
||||||
@ -415,32 +416,31 @@ Open PostgreSQL terminal to list the saved event notification logs.
|
|||||||
```
|
```
|
||||||
bucketevents_db=# select * from bucketevents;
|
bucketevents_db=# select * from bucketevents;
|
||||||
|
|
||||||
key | value
|
key | value
|
||||||
--------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
--------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
images/myphoto.jpg | {"Records": [{"s3": {"bucket": {"arn": "arn:aws:s3:::images", "name": "images", "ownerIdentity": {"principalId": "minio"}}, "object": {"key": "myphoto.jpg", "eTag": "1d97bf45ecb37f7a7b699418070df08f", "size": 56060, "sequencer": "147CE57C70B31931"}, "configurationId": "Config", "s3SchemaVersion": "1.0"}, "awsRegion": "us-east-1", "eventName": "s3:ObjectCreated:Put", "eventTime": "2016-10-12T21:18:20Z", "eventSource": "aws:s3", "eventVersion": "2.0", "userIdentity": {"principalId": "minio"}, "responseElements": {}, "requestParameters": {"sourceIPAddress": "[::1]:39706"}}]}
|
images/myphoto.jpg | {"Records": [{"s3": {"bucket": {"arn": "arn:aws:s3:::images", "name": "images", "ownerIdentity": {"principalId": "minio"}}, "object": {"key": "myphoto.jpg", "eTag": "1d97bf45ecb37f7a7b699418070df08f", "size": 56060, "sequencer": "147CE57C70B31931"}, "configurationId": "Config", "s3SchemaVersion": "1.0"}, "awsRegion": "us-east-1", "eventName": "s3:ObjectCreated:Put", "eventTime": "2016-10-12T21:18:20Z", "eventSource": "aws:s3", "eventVersion": "2.0", "userIdentity": {"principalId": "minio"}, "responseElements": {}, "requestParameters": {"sourceIPAddress": "[::1]:39706"}}]}
|
||||||
(1 row)
|
(1 row)
|
||||||
```
|
```
|
||||||
|
|
||||||
<a name="kafka"></a>
|
<a name="apache-kafka"></a>
|
||||||
## Publish Minio events via kafka
|
## Publish Minio events via kafka
|
||||||
|
|
||||||
Install kafka from [here](http://kafka.apache.org/).
|
Install kafka from [here](http://kafka.apache.org/).
|
||||||
|
|
||||||
## Recipe steps
|
|
||||||
|
|
||||||
### Step 1: Add kafka endpoint to Minio
|
### 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:
|
The default location of Minio server configuration file is ``~/.minio/config.json``. Update the kafka configuration block in ``config.json`` as follows:
|
||||||
|
|
||||||
```
|
```
|
||||||
"kafka": {
|
"kafka": {
|
||||||
"1": {
|
"1": {
|
||||||
"enable": true,
|
"enable": true,
|
||||||
"brokers": ["localhost:9092"],
|
"brokers": ["localhost:9092"],
|
||||||
"topic": "bucketevents"
|
"topic": "bucketevents"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Restart Minio server to reflect config changes. ``bucketevents`` is the topic used by kafka in this example.
|
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
|
### Step 2: Enable bucket notification using Minio client
|
Loading…
x
Reference in New Issue
Block a user