You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
4.9 KiB
4.9 KiB
S3 Bucket Management
The SeaweedFS Admin Interface now includes comprehensive S3 bucket management capabilities.
Features
Bucket Overview
- Dashboard View: List all S3 buckets with summary statistics
- Bucket Statistics: Total buckets, storage usage, object counts
- Status Monitoring: Real-time bucket status and health indicators
Bucket Operations
- Create Buckets: Create new S3 buckets
- Delete Buckets: Remove buckets and all their contents (with confirmation)
- View Details: Browse bucket contents and object listings
- Export Data: Export bucket lists to CSV format
Bucket Information
Each bucket displays:
- Name: Bucket identifier
- Created Date: When the bucket was created
- Object Count: Number of objects stored
- Total Size: Storage space used (formatted in KB/MB/GB/TB)
- Region: Configured AWS region
- Status: Current operational status
Usage
Accessing S3 Bucket Management
-
Start the admin server:
weed admin -port=23646 -masters=localhost:9333 -filer=localhost:8888
-
Open your browser to:
http://localhost:23646
-
Click the "S3 Buckets" button in the dashboard toolbar
-
Or navigate directly to:
http://localhost:23646/s3/buckets
Creating a New Bucket
- Click the "Create Bucket" button
- Enter a valid bucket name (3-63 characters, lowercase letters, numbers, dots, hyphens)
- Select a region (defaults to us-east-1)
- Click "Create Bucket"
Deleting a Bucket
- Click the trash icon next to the bucket name
- Confirm the deletion in the modal dialog
- Warning: This permanently deletes the bucket and all its contents
Viewing Bucket Details
- Click on a bucket name to view detailed information
- See all objects within the bucket
- View object metadata (size, last modified, etc.)
API Endpoints
The S3 bucket management feature exposes REST API endpoints:
List Buckets
GET /api/s3/buckets
Returns JSON array of all buckets with metadata.
Create Bucket
POST /api/s3/buckets
Content-Type: application/json
{
"name": "my-bucket-name",
"region": "us-east-1"
}
Delete Bucket
DELETE /api/s3/buckets/{bucket-name}
Permanently deletes the bucket and all contents.
Get Bucket Details
GET /api/s3/buckets/{bucket-name}
Returns detailed bucket information including object listings.
Technical Implementation
Backend Integration
- Filer Integration: Uses SeaweedFS filer for bucket storage at
/buckets/
- Streaming API: Efficiently handles large bucket listings
- Error Handling: Comprehensive error reporting and recovery
Frontend Features
- Bootstrap UI: Modern, responsive web interface
- Real-time Updates: Automatic refresh after operations
- Form Validation: Client-side bucket name validation
- Modal Dialogs: User-friendly create/delete workflows
Security Considerations
- Confirmation Dialogs: Prevent accidental deletions
- Input Validation: Prevent invalid bucket names
- Error Messages: Clear feedback for failed operations
Bucket Naming Rules
S3 bucket names must follow these rules:
- 3-63 characters in length
- Contain only lowercase letters, numbers, dots (.), and hyphens (-)
- Start and end with a lowercase letter or number
- Cannot contain spaces or special characters
- Cannot be formatted as an IP address
Storage Structure
Buckets are stored in the SeaweedFS filer at:
/buckets/{bucket-name}/
Each bucket directory contains:
- Object files with their original names
- Nested directories for object key prefixes
- Metadata preserved from S3 operations
Performance Notes
- Lazy Loading: Bucket sizes and object counts are calculated on-demand
- Streaming: Large bucket listings use streaming responses
- Caching: Cluster topology data is cached for performance
- Pagination: Large object lists are handled efficiently
Troubleshooting
Common Issues
-
Bucket Creation Fails
- Check bucket name follows S3 naming rules
- Ensure filer is accessible and running
- Verify sufficient storage space
-
Bucket Deletion Fails
- Ensure bucket exists and is accessible
- Check for permission issues
- Verify filer connectivity
-
Bucket List Empty
- Verify filer has
/buckets/
directory - Check filer connectivity
- Ensure buckets were created through S3 API
- Verify filer has
Debug Steps
- Check admin server logs for error messages
- Verify filer is running and accessible
- Test filer connectivity:
curl http://localhost:8888/
- Check browser console for JavaScript errors
Future Enhancements
- Bucket Policies: Manage access control policies
- Lifecycle Rules: Configure object lifecycle management
- Versioning: Enable/disable bucket versioning
- Replication: Configure cross-region replication
- Metrics: Detailed usage and performance metrics
- Notifications: Bucket event notifications
- Search: Search and filter bucket contents