MinIO 支持多种多样的通知目标,这些通知目标均可以在 .minio.sys\config\config.json 中进行配置。目前支持的通知种类如下:
Webhook 是一个 API 概念,并且变得越来越流行。我们能用事件描述的事物越多,Webhook 的作用范围也就越大。Webhook 作为一个轻量的事件处理应用,正变得越来越有用。
准确的说 Webhook 是一种 web 回调或者 http 的 push API,是向 APP 或者其他应用提供实时信息的一种方式。Webhook 在数据产生时立即发送数据,也就是你能实时收到数据。这一种不同于典型的API,需要用了实时性需要足够快的轮询。这无论是对生产还是对消费者都是高效的,唯一的缺点是初始建立困难。
Webhook 有时也被称为反向 API,因为他提供了 API 规则,你需要设计要使用的 API。Webhook 将向你的应用发起http请求,典型的是 post 请求,应用程序由请求驱动。
Webhook 模式的主要优点是,当你的应用在等待变化时,无需周期性地调用APIs
MinIO 服务器允许将存储桶通知发布到 webhook 端点,配置如下:
{ //... "notify_webhook": { "_": [{ "key": "enable", "value": "off" }, { "key": "endpoint", "value": "" }, { "key": "auth_token", "value": "" }, { "key": "queue_limit", "value": "0" }, { "key": "queue_dir", "value": "" }, { "key": "client_cert", "value": "" }, { "key": "client_key", "value": "" } ] }, //... }
AMQP,即Advanced Message Queuing Protocol,一个提供统一消息服务的应用层标准高级消息队列协议,是应用层协议的一个开放标准,为面向消息的中间件设计。
MinIO 服务允许将存储桶通知发布到 AMQP 端点,配置如下:
{ //... "notify_amqp": { "_": [{ "key": "enable", "value": "off" }, { "key": "url", "value": "amqp://localhost:5672" }, { "key": "exchange", "value": "bucketevents" }, { "key": "exchange_type", "value": "fanout" }, { "key": "routing_key", "value": "bucketlogs" }, { "key": "mandatory", "value": "off" }, { "key": "durable", "value": "off" }, { "key": "no_wait", "value": "off" }, { "key": "internal", "value": "off" }, { "key": "auto_deleted", "value": "off" }, { "key": "delivery_mode", "value": "0" }, { "key": "publisher_confirms", "value": "off" }, { "key": "queue_limit", "value": "0" }, { "key": "queue_dir", "value": "" } ] }, //... }
Kafka是由Apache软件基金会开发的一个开源流处理平台,由Scala和Java编写。Kafka是一种高吞吐量的分布式发布订阅消息系统,它可以处理消费者在网站中的所有动作流数据。
MinIO 服务允许将存储桶通知发布到 Kafka 端点,配置如下:
{ //... "notify_kafka": { "_": [{ "key": "enable", "value": "off" }, { "key": "topic", "value": "" }, { "key": "brokers", "value": "" }, { "key": "sasl_username", "value": "" }, { "key": "sasl_password", "value": "" }, { "key": "sasl_mechanism", "value": "plain" }, { "key": "client_tls_cert", "value": "" }, { "key": "client_tls_key", "value": "" }, { "key": "tls_client_auth", "value": "0" }, { "key": "sasl", "value": "off" }, { "key": "tls", "value": "off" }, { "key": "tls_skip_verify", "value": "off" }, { "key": "queue_limit", "value": "0" }, { "key": "queue_dir", "value": "" }, { "key": "version", "value": "" } ] }, //... }
MQTT(Message Queuing Telemetry Transport,消息队列遥测传输协议),是一种基于发布/订阅(publish/subscribe)模式的"轻量级"通讯协议,该协议构建于TCP/IP协议上,由IBM在1999年发布。
MinIO服务允许将存储桶通知发布到 MQTT 端点,配置如下:
{ //... "notify_mqtt": { "_": [{ "key": "enable", "value": "off" }, { "key": "broker", "value": "" }, { "key": "topic", "value": "" }, { "key": "password", "value": "" }, { "key": "username", "value": "" }, { "key": "qos", "value": "0" }, { "key": "keep_alive_interval", "value": "0s" }, { "key": "reconnect_interval", "value": "0s" }, { "key": "queue_dir", "value": "" }, { "key": "queue_limit", "value": "0" } ] }, //... }
nats是一个开源的,云原生的消息系统。Apcera,百度,西门子,VMware,HTC和爱立信等公司都有在使用。
MinIO服务允许将存储桶通知发布到 NATS 端点,配置如下:
{ //... "notify_nats": { "_": [{ "key": "enable", "value": "off" }, { "key": "address", "value": "" }, { "key": "subject", "value": "" }, { "key": "username", "value": "" }, { "key": "password", "value": "" }, { "key": "token", "value": "" }, { "key": "tls", "value": "off" }, { "key": "tls_skip_verify", "value": "off" }, { "key": "cert_authority", "value": "" }, { "key": "client_cert", "value": "" }, { "key": "client_key", "value": "" }, { "key": "ping_interval", "value": "0" }, { "key": "streaming", "value": "off" }, { "key": "streaming_async", "value": "off" }, { "key": "streaming_max_pub_acks_in_flight", "value": "0" }, { "key": "streaming_cluster_id", "value": "" }, { "key": "queue_dir", "value": "" }, { "key": "queue_limit", "value": "0" } ] }, //... }
NSQ 是无中心设计、节点自动注册和发现的开源消息系统。可作为内部通讯框架的基础,易于配置和发布。
MinIO 服务允许将存储桶通知发布到 NSQ 端点,配置如下:
{ //... "notify_nsq": { "_": [{ "key": "enable", "value": "off" }, { "key": "nsqd_address", "value": "" }, { "key": "topic", "value": "" }, { "key": "tls", "value": "off" }, { "key": "tls_skip_verify", "value": "off" }, { "key": "queue_dir", "value": "" }, { "key": "queue_limit", "value": "0" } ] }, //... }
MinIO 服务允许将存储桶通知发布到 MySQL 数据库,配置如下:
{ //... "notify_mysql": { "_": [{ "key": "enable", "value": "off" }, { "key": "format", "value": "namespace" }, { "key": "dsn_string", "value": "root:aaaaaa@tcp(127.0.0.1:3306)/miniodb" }, { "key": "table", "value": "minio_images" }, { "key": "queue_dir", "value": "" }, { "key": "queue_limit", "value": "0" }, { "key": "max_open_connections", "value": "2" } ] }, //... }
MinIO 服务允许将存储桶通知发布到 Postgres 数据库,配置如下:
{ //... "notify_postgres": { "_": [{ "key": "enable", "value": "off" }, { "key": "format", "value": "namespace" }, { "key": "connection_string", "value": "" }, { "key": "table", "value": "" }, { "key": "queue_dir", "value": "" }, { "key": "queue_limit", "value": "0" }, { "key": "max_open_connections", "value": "2" } ] }, //... }
Elasticsearch是一个基于Lucene的搜索服务器。它提供了一个分布式多用户能力的全文搜索引擎,基于RESTful web接口。Elasticsearch是用Java语言开发的,并作为Apache许可条款下的开放源码发布,是一种流行的企业级搜索引擎。
MinIO 服务允许将存储桶通知发布到 Elasticsearch 端点,配置如下:
{ //... "notify_elasticsearch": { "_": [{ "key": "enable", "value": "off" }, { "key": "url", "value": "" }, { "key": "format", "value": "namespace" }, { "key": "index", "value": "" }, { "key": "queue_dir", "value": "" }, { "key": "queue_limit", "value": "0" }, { "key": "username", "value": "" }, { "key": "password", "value": "" } ] }, //... }
Redis(Remote Dictionary Server ),即远程字典服务,是一个开源的使用ANSI C语言编写、支持网络、可基于内存亦可持久化的日志型、Key-Value数据库,并提供多种语言的API。
MinIO 服务允许将存储桶通知发布到 Redis 数据存储,配置如下:
{ //... "notify_redis": { "_": [{ "key": "enable", "value": "off" }, { "key": "format", "value": "namespace" }, { "key": "address", "value": "127.0.0.1:6379" }, { "key": "key", "value": "bucketevents" }, { "key": "password", "value": "" }, { "key": "queue_dir", "value": "" }, { "key": "queue_limit", "value": "0" } ] }, //... }