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 b e added for each configuration, (e.g."notify_mysql:myinstance").
ARGS:
dsn_string*          (string)            MySQL data-source-name connection "<user>:<password>@tcp(<host>:<port>)/<database>"
table*              (string)            DB table name to store/update events, table is auto-created
mysql下载配置format*              (namespace*|access)  'namespace' reflects current bucket/object list and 'access' reflects a journal of object operations, defaults to 'names pace'
queue_dir            (path)              staging dir for undelivered '/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
要能够使⽤还需要启动服务(集的话需要重启每个节点服务)

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。