1. 集群安装
https://www.yepk.cn/archives/minio-cluster.html
2. minio创建桶
- 1.打开minio后台,右下角创建桶即可。
- 2.mc命令创建桶
./mc mb minio/public桶名
Bucket created successfully `minio/public桶名`.
- 3.代码创建
try
{
// 判断存储桶是否存在
bool found = await minioClient.BucketExistsAsync("mybucket");
if (found)
{
Console.Out.WriteLine("mybucket already exists");
}
else
{
// 创建桶
await minioClient.MakeBucketAsync("mybucket");
Console.Out.WriteLine("mybucket is created successfully");
}
}
catch (MinioException e)
{
Console.Out.WriteLine("Error occurred: " + e);
}
推荐在后台创建。
3. 桶权限配置,访问策略设(公开访问)
- 命令行
cd /data/minio/
wget https://dl.min.io/client/mc/release/linux-amd64/mc
#添加host 添加Key
./mc config host add minio http://10.51.52.20:9000 xxxxx(账号) xxxxx(密码)
# 设置捅公开访问
./mc policy set public(访问级别) minio/public/(桶名)
./mc policy set public minio/public/
- 后台设置