Updated S3 Bucket Quota (markdown)

Chris Lu 2022-01-21 03:10:20 -08:00
parent ba92acc96f
commit a6bbe83e76

@ -2,17 +2,16 @@
There are two aspects of quota management: "quota configuration" and "quota enforcement".
"Quota Configuration" is done in by admin scripts in `weed shell`, where you can set/remove/enable/disable bucket quota.
* "Quota Configuration" is done in by an admin script in `weed shell`, where you can set/remove/enable/disable bucket quota.
* "Quota Enforcement" is actually also an admin script, which you can run it regularly by adding it to `master.toml`. It will check whether all the buckets are over their limit or not. If one bucket is over quota, it will be set to read only.
"Quota Enforcement" is actually also one admin script, which you can run it regularly by adding it to `master.toml`. It will check whether one bucket is over the limit or not, and configure the bucket to be read only or not.
The bucket read only attribute is checked when filer process write requests. If the bucket is read only, the creation and update requests on this bucket will be denied, except deletion.
The bucket read only attribute is checked when filer process write requests. If the bucket is read only, the creation and update requests on this bucket will be denied, except deletion. The read operations will not be affected.
# Quota Configuration and Enforcement
**1. View current bucket usage**
Here there are 3 buckets created. Each bucket size and file count are listed. The bucket size is the actual disk space used, including replicated copies.
Here there are 3 example buckets created. Each bucket size and file count are listed. The bucket size is the actual disk space used, including replicated copies.
```
> s3.bucket.list
@ -35,9 +34,6 @@ updated quota for bucket b1
**3. Enforce the quota, and found it should be set to read only.**
The filer configuration is changed to read only for this bucket.
Now, when new write request comes in, the filer will just say this is a read only folder.
```
> s3.bucket.quota.enforce -apply
b1 size:527971104 quota:15728640 usage:3356.75%
@ -52,4 +48,5 @@ Now, when new write request comes in, the filer will just say this is a read onl
]
}
```
```
Actually the filer configuration is changed to read only for this bucket. So you could directly change the bucket `readOnly` property with `fs.configure` also.