mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-11-24 02:59:13 +08:00
Page:
Volume Server API
Pages
AWS CLI with SeaweedFS
AWS IAM CLI
Actual Users
Amazon IAM API
Amazon S3 API
Applications
Async Backup
Async Filer Metadata Backup
Async Replication to Cloud
Async Replication to another Filer
Benchmark SeaweedFS as a GlusterFS replacement
Benchmarks from jinleileiking
Benchmarks
Cache Remote Storage
Choosing a Filer Store
Client Libraries
Cloud Drive Architecture
Cloud Drive Benefits
Cloud Drive Quick Setup
Cloud Monitoring
Cloud Tier
Components
Configure Remote Storage
Customize Filer Store
Data Backup
Data Structure for Large Files
Deployment to Kubernetes and Minikube
Directories and Files
Docker Compose for S3
Docker Image Registry with SeaweedFS
Environment Variables
Erasure Coding for warm storage
Error reporting to sentry
FAQ
FIO benchmark
FUSE Mount
Failover Master Server
Filer Active Active cross cluster continuous synchronization
Filer Cassandra Setup
Filer Change Data Capture
Filer Commands and Operations
Filer Data Encryption
Filer JWT Use
Filer Metadata Events
Filer Redis Setup
Filer Server API
Filer Setup
Filer Store Replication
Filer Stores
Filer as a Key Large Value Store
Gateway to Remote Object Storage
Getting Started
HDFS via S3 connector
Hadoop Benchmark
Hadoop Compatible File System
Hardware
Hobbyest Tinkerer scale on premises tutorial
Home
Independent Benchmarks
Kubernetes Backups and Recovery with K8up
Large File Handling
Load Command Line Options from a file
Master Server API
Migrate to Filer Store
Mount Remote Storage
Optimization
Path Specific Configuration
Path Specific Filer Store
Production Setup
Replication
Run Blob Storage on Public Internet
Run Presto on SeaweedFS
S3 API Audit log
S3 API Benchmark
S3 API FAQ
S3 Bucket Quota
S3 Nginx Proxy
SRV Service Discovery
SeaweedFS Java Client
SeaweedFS in Docker Swarm
Security Configuration
Security Overview
Server Startup Setup
Store file with a Time To Live
Super Large Directories
System Metrics
TensorFlow with SeaweedFS
Tiered Storage
UrBackup with SeaweedFS
Use Cases
Volume Files Structure
Volume Management
Volume Server API
WebDAV
Words from SeaweedFS Users
fstab
nodejs with Seaweed S3
rclone with SeaweedFS
restic with SeaweedFS
run HBase on SeaweedFS
run Spark on SeaweedFS
s3cmd with SeaweedFS
weed shell
20
Volume Server API
monchickey edited this page 2023-01-07 11:41:07 +08:00
You can append to any HTTP API with &pretty=y
to see a formatted json output.
Volume Server Reads
GET/HEAD operations are direction http requests to file ids, e.g., http://127.0.0.1:8080/3,01637037d6
.
URL Parameter | Description | Default |
---|---|---|
readDeleted | if "true", possibly read a deleted file. Does not work if volume server is restarted or the volume is compacted. | false |
width | if the stored file has ".png", ".jpg", ".jpeg", ".gif", apply resizing | empty |
height | if the stored file has ".png", ".jpg", ".jpeg", ".gif", apply resizing | empty |
mode | if resizing, "fit", or "fill". Or just resizing, unless width==height, which default to thumbnail mode | empty |
crop_x1 | if the stored file has ".png", ".jpg", ".jpeg", ".gif", apply cropping, requires: 0 <= value < image width | empty |
crop_y1 | if the stored file has ".png", ".jpg", ".jpeg", ".gif", apply cropping, requires: 0 <= value < image height | empty |
crop_x2 | if the stored file has ".png", ".jpg", ".jpeg", ".gif", apply cropping, requires: crop_x1 < value <= image width | empty |
crop_y2 | if the stored file has ".png", ".jpg", ".jpeg", ".gif", apply cropping, requires: crop_y1 < value <= image height | empty |
Request Header | Description | Default |
---|---|---|
Authorization | Json Web Token for reads issued by master | empty |
Range | for http range request, support multiple ranges | empty |
If-Modified-Since | format "Mon, 02 Jan 2006 15:04:05 GMT", if not modified, return StatusNotModified 304 | empty |
If-None-Match | if matches the ETag, return StatusNotModified 304 | empty |
Accept-Encoding: gzip | compress response by gzip | empty |
Volume Server Writes
Upload File
curl -F file=@/home/chris/myphoto.jpg http://127.0.0.1:8080/3,01637037d6
{"size": 43234}
The size returned is the size stored on SeaweedFS, sometimes the file is automatically gzipped based on the file extension or mime type (see when compression will be applied automatically).
URL Parameter | Description | Default |
---|---|---|
fsync | if "true", the write will incur an fsync operation | false |
type | if "replicate", this is a replicated request, so the writes will not be replicated to other volume servers | empty |
ts | modification timestamp in epoch seconds | empty |
cm | content is a chunk manifest file | empty |
Request Header | Description | Default |
---|---|---|
Content-Encoding: gzip | the uploaded content is already compressed to gzip | empty |
Content-Type | use the specified content type | "application/octet-stream" |
Content-MD5 | verify the uploaded content by MD5. MD5 digest needs to be encoded as base64 string. | empty |
Authorization | Json Web Token for writes issued by master | empty |
Seaweed-xxxxx | Any key-value pair with custom Seaweed- prefix. All the custom key-value data are stored as json, should be less than 64KB. The key will trim out the Seaeweed- prefix and then convert into a canonical header key. See https://golang.org/pkg/net/http/#CanonicalHeaderKey |
empty |
Upload File Directly
curl -F file=@/home/chris/myphoto.jpg http://localhost:9333/submit
{"fid":"3,01fbe0dc6f1f38","fileName":"myphoto.jpg","fileUrl":"localhost:8080/3,01fbe0dc6f1f38","size":68231}
This API is just for convenience. The master server would get a file id and store the file to the right volume server. It is a convenient API and does not support different parameters when assigning file id. (or you can add the support and make a pull request.)
Delete File
curl -X DELETE http://127.0.0.1:8080/3,01637037d6
View Manifest File Content for chunked big file
curl http://127.0.0.1:8080/3,01637037d6?cm=false
Check Volume Server Status
curl "http://localhost:8080/status?pretty=y"
{
"Version": "0.34",
"Volumes": [
{
"Id": 1,
"Size": 1319688,
"RepType": "000",
"Version": 2,
"FileCount": 276,
"DeleteCount": 0,
"DeletedByteCount": 0,
"ReadOnly": false
},
{
"Id": 2,
"Size": 1040962,
"RepType": "000",
"Version": 2,
"FileCount": 291,
"DeleteCount": 0,
"DeletedByteCount": 0,
"ReadOnly": false
},
{
"Id": 3,
"Size": 1486334,
"RepType": "000",
"Version": 2,
"FileCount": 301,
"DeleteCount": 2,
"DeletedByteCount": 0,
"ReadOnly": false
},
{
"Id": 4,
"Size": 8953592,
"RepType": "000",
"Version": 2,
"FileCount": 320,
"DeleteCount": 2,
"DeletedByteCount": 0,
"ReadOnly": false
},
{
"Id": 5,
"Size": 70815851,
"RepType": "000",
"Version": 2,
"FileCount": 309,
"DeleteCount": 1,
"DeletedByteCount": 0,
"ReadOnly": false
},
{
"Id": 6,
"Size": 1483131,
"RepType": "000",
"Version": 2,
"FileCount": 301,
"DeleteCount": 1,
"DeletedByteCount": 0,
"ReadOnly": false
},
{
"Id": 7,
"Size": 46797832,
"RepType": "000",
"Version": 2,
"FileCount": 292,
"DeleteCount": 0,
"DeletedByteCount": 0,
"ReadOnly": false
}
]
}
Introduction
API
Configuration
- Replication
- Store file with a Time To Live
- Failover Master Server
- Erasure coding for warm storage
- Server Startup Setup
- Environment Variables
Filer
- Filer Setup
- Directories and Files
- Data Structure for Large Files
- Filer Data Encryption
- Filer Commands and Operations
- Filer JWT Use
Filer Stores
- Filer Cassandra Setup
- Filer Redis Setup
- Super Large Directories
- Path-Specific Filer Store
- Choosing a Filer Store
- Customize Filer Store
Advanced Filer Configurations
- Migrate to Filer Store
- Add New Filer Store
- Filer Store Replication
- Filer Active Active cross cluster continuous synchronization
- Filer as a Key-Large-Value Store
- Path Specific Configuration
- Filer Change Data Capture
FUSE Mount
WebDAV
Cloud Drive
- Cloud Drive Benefits
- Cloud Drive Architecture
- Configure Remote Storage
- Mount Remote Storage
- Cache Remote Storage
- Cloud Drive Quick Setup
- Gateway to Remote Object Storage
AWS S3 API
- Amazon S3 API
- AWS CLI with SeaweedFS
- s3cmd with SeaweedFS
- rclone with SeaweedFS
- restic with SeaweedFS
- nodejs with Seaweed S3
- S3 API Benchmark
- S3 API FAQ
- S3 Bucket Quota
- S3 API Audit log
- S3 Nginx Proxy
- Docker Compose for S3
AWS IAM
Machine Learning
HDFS
- Hadoop Compatible File System
- run Spark on SeaweedFS
- run HBase on SeaweedFS
- run Presto on SeaweedFS
- Hadoop Benchmark
- HDFS via S3 connector
Replication and Backup
- Async Replication to another Filer [Deprecated]
- Async Backup
- Async Filer Metadata Backup
- Async Replication to Cloud [Deprecated]
- Kubernetes Backups and Recovery with K8up
Messaging
Use Cases
Operations
Advanced
- Large File Handling
- Optimization
- Volume Management
- Tiered Storage
- Cloud Tier
- Cloud Monitoring
- Load Command Line Options from a file
- SRV Service Discovery
- Volume Files Structure