mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Created S3 Bucket Quota (markdown)
parent
c8a958a74d
commit
72584c15bc
44
S3-Bucket-Quota.md
Normal file
44
S3-Bucket-Quota.md
Normal file
|
@ -0,0 +1,44 @@
|
|||
The bucket quota management is implemented by admin scripts in `weed shell`.
|
||||
|
||||
**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.
|
||||
|
||||
```
|
||||
> s3.bucket.list
|
||||
b1 size:527971104 file:151
|
||||
b2 size:468432 file:6
|
||||
b3 size:10280 file:3
|
||||
```
|
||||
|
||||
**2. Set bucket "b1" to a low quota**
|
||||
|
||||
```
|
||||
> s3.bucket.quota -name b1 -sizeMB 15
|
||||
updated quota for bucket b1
|
||||
> s3.bucket.list
|
||||
b1 size:527971104 file:151 quota:15728640 usage:3356.75%
|
||||
b2 size:468432 file:6
|
||||
b3 size:10280 file:3
|
||||
```
|
||||
|
||||
**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%
|
||||
changing bucket b1 to read only!
|
||||
{
|
||||
"locations": [
|
||||
{
|
||||
"locationPrefix": "/buckets/b1/",
|
||||
"collection": "b1",
|
||||
"readOnly": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
```
|
Loading…
Reference in a new issue