minio 服务器部署,设置并 配置压缩

限于喜欢 提交于 2020-12-08 13:56:56

1.服务端部署

wget https://dl.minio.io/server/minio/release/linux-amd64/minio
chmod +x minio
# 启动后会打印出AccessKey和SecretKey等信息
./minio server /data/minio_oss_srv 
# 后台运行
nohup ./minio server /data/minio_oss_srv > /data/logs/minio/minio.log 2>&1 &
#开放9000端口 
firewall-cmd --zone=public --add-port=9000/tcp --permanent 
firewall-cmd --reload
#自定义端口号
./minio server --address 101.121.115.159:9001 /data/minio_oss_srv

2.客户端部署

wget https://dl.min.io/client/mc/release/linux-amd64/mc
chmod +x mc
./mc --help

3.配置MySQL发布minio事件

#mc配置本地minio服务
$ ./mc config host add myminio http://127.0.0.1:9000 yourAccessKey yourSecretKey
$ ./mc admin config get myminio/ notify_mysql
notify_mysql table="" database="" format="namespace" password="" port="" queue_dir="" queue_limit="0"  username="" dsn_string="" host=""
$  ./mc admin config set myminio notify_mysql table="minio_images" format="namespace" queue_limit="0"   dsn_string="user:password@tcp(localhost:3306)/dbname"
# Add notification configuration on the `images` bucket using the MySQL ARN. 
$ ./mc event add myminio/images arn:minio:sqs::_:mysql
#重启minio,控制台会打印 SQS ARNs: arn:minio:sqs::_:mysql
$ ./mc admin service restart myminio

4.配置minio启用压缩

#查看压缩配置
$ ./mc admin config get myminio compression
compression extensions=".txt,.log,.csv,.json,.tar,.xml,.bin" mime_types="text/*,application/json,application/xml"
#通过环境变量启用配置
export MINIO_COMPRESS="on"
export MINIO_COMPRESS_EXTENSIONS=".pdf,.doc"
export MINIO_COMPRESS_MIME_TYPES="application/pdf"
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!