minio mysql_MinIO入门(四)——Mysql存储桶通知配置

**!!!中文社区中说的config.json的方式已经打算被废弃了,所以现在最好通过minio客户端的方式进行处理了**

· 在目标mysql创建数据库miniodb(要用默认字符集,不然会报错)

· 在minio client的可执行目录下执行如下命令,查看是否已经存在配置

./mc --insecure admin config get myminio notify_mysql

不存在就会如下打印:

notify_mysql enable=off format=namespace dsn_string= table= queue_dir= queue_limit=0 max_open_connections=2

· 添加Mysql通知配置

./mc --insecure admin config set myminio notify_mysql:myinstance table="minio_images" dsn_string="root:Centerm&123@tcp(10.17.70.6:3306)/miniodb"

参数说明

KEY:

notify_mysql[:name] publish bucket notifications to MySQL databases. When multiple MySQL server endpoints are needed, a user specified "name" can be added for each configuration, (e.g."notify_mysql:myinstance").

ARGS:

dsn_string* (string) MySQL data-source-name connection string e.g. ":@tcp(:)/"

table* (string) DB table name to store/update events, table is auto-created

format* (namespace*|access) 'namespace' reflects current bucket/object list and 'access' reflects a journal of object operations, defaults to 'namespace'

queue_dir (path) staging dir for undelivered messages e.g. '/home/events'

queue_limit (number) maximum limit for undelivered messages, defaults to '100000'

max_open_connections (number) maximum number of open connections to the database, defaults to '2'

comment (sentence) optionally add a comment to this setting

添加成功会有成功的提示信息

Setting new key has been successful.

Please restart your server with `mc admin service restart myminio`.

· 在minio client的可执行目录下执行如下命令,查看是否已经存在配置

./mc --insecure admin config get myminio notify_mysql

存在会有如下打印:

notify_mysql:myinstance format=namespace dsn_string=root:Centerm&123@tcp(10.17.70.6:3306)/miniodb table=minio_images queue_dir= queue_limit=0 max_open_connections=2

要能够使用还需要启动服务(集群的话需要重启每个节点服务)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值