mirror of
https://github.com/minio/minio.git
synced 2025-04-01 10:13:42 -04:00
Add docs for bucket quota feature (#9503)
This PR also adds a check to not enforce bucket quota for server-side metadata copy of an object onto itself.
This commit is contained in:
parent
daf4418cbb
commit
011a2c0b78
@ -879,9 +879,11 @@ func (api objectAPIHandlers) CopyObjectHandler(w http.ResponseWriter, r *http.Re
|
|||||||
}
|
}
|
||||||
length = actualSize
|
length = actualSize
|
||||||
}
|
}
|
||||||
if err := enforceBucketQuota(ctx, dstBucket, actualSize); err != nil {
|
if !cpSrcDstSame {
|
||||||
writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL, guessIsBrowserReq(r))
|
if err := enforceBucketQuota(ctx, dstBucket, actualSize); err != nil {
|
||||||
return
|
writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL, guessIsBrowserReq(r))
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var compressMetadata map[string]string
|
var compressMetadata map[string]string
|
||||||
|
45
docs/bucket/quota/README.md
Normal file
45
docs/bucket/quota/README.md
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
# Bucket Quota Configuration Quickstart Guide [](https://slack.min.io) [](https://hub.docker.com/r/minio/minio/)
|
||||||
|
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
Buckets can be configured to have one of two types of quota configuration - FIFO and Hard quota.
|
||||||
|
|
||||||
|
- `Hard` quota disallows writes to the bucket after configured quota limit is reached.
|
||||||
|
|
||||||
|
- `FIFO` quota automatically deletes oldest content until bucket usage falls within configured limit while permitting writes.
|
||||||
|
|
||||||
|
## 1. Prerequisites
|
||||||
|
- Install MinIO - [MinIO Quickstart Guide](https://docs.min.io/docs/minio-quickstart-guide).
|
||||||
|
- [Use `mc` with MinIO Server](https://docs.min.io/docs/minio-client-quickstart-guide)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 2. Set bucket quota configuration
|
||||||
|
|
||||||
|
1. Set a hard quota of 1GB for a bucket `mybucket` on MinIO
|
||||||
|
object storage:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ mc admin bucket quota myminio/mybucket --hard 1gb
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Set FIFO quota of 5GB for a bucket "mybucket" on MinIO to allow automatic deletion of
|
||||||
|
older content to ensure bucket usage remains within 5GB
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ mc admin bucket quota myminio/mybucket --fifo 5gb
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Verify the quota configured on `mybucket` on MinIO
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ mc admin bucket quota myminio/mybucket
|
||||||
|
```
|
||||||
|
|
||||||
|
4. Clear bucket quota configuration for `mybucket` on MinIO
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ mc admin bucket quota myminio/mybucket --clear
|
||||||
|
```
|
BIN
docs/bucket/quota/bucketquota.png
Normal file
BIN
docs/bucket/quota/bucketquota.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 95 KiB |
Loading…
x
Reference in New Issue
Block a user