...
Endpoint:
DELETE /api/files/delete/{filename}
Headers: None
Response: Confirmation message.
Export “File Management API.postman_collection.json“ into postman
Elite soft json viewer | ||||||
---|---|---|---|---|---|---|
| ||||||
{ "info": { "_postman_id": "442dfc38-0352-4b0c-ba1f-79b40a9f5386", "name": "File Management API", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", "_exporter_id": "31031320", "_collection_link": "https://cps999-2753.postman.co/workspace/cps-Workspace~2d457640-a1d5-492a-9918-6eae800aacc2/collection/31031320-442dfc38-0352-4b0c-ba1f-79b40a9f5386?action=share&source=collection_link&creator=31031320" }, "item": [ { "name": "File Upload", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "multipart/form-data" } ], "body": { "mode": "formdata", "formdata": [ { "key": "file", "type": "file", "src": "/C:/Users/SourabhSourabh/Downloads/jdk-17.0.12_windows-x64_bin.exe" } ] }, "url": { "raw": "{{base_url}}/api/files/upload", "host": [ "{{base_url}}" ], "path": [ "api", "files", "upload" ] } }, "response": [] }, { "name": "List Files", "request": { "method": "GET", "header": [], "url": { "raw": "{{base_url}}/api/files/list?base_url=http://localhost:8000", "host": [ "{{base_url}}" ], "path": [ "api", "files", "list" ], "query": [ { "key": "base_url", "value": "http://localhost:8000" } ] } }, "response": [] }, { "name": "Download File", "request": { "method": "GET", "header": [], "url": { "raw": "{{base_url}}/api/files/download/{{filename}}", "host": [ "{{base_url}}" ], "path": [ "api", "files", "download", "{{filename}}" ], "variable": [ { "key": "filename", "value": "" } ] } }, "response": [] }, { "name": "Delete File", "request": { "method": "DELETE", "header": [], "url": { "raw": "{{base_url}}/api/files/delete/{{filename}}", "host": [ "{{base_url}}" ], "path": [ "api", "files", "delete", "{{filename}}" ], "variable": [ { "key": "filename", "value": "Screenshot 2024-11-12 133157.png" } ] } }, "response": [] } ], "event": [ { "listen": "prerequest", "script": { "type": "text/javascript", "packages": {}, "exec": [ "" ] } }, { "listen": "test", "script": { "type": "text/javascript", "packages": {}, "exec": [ "" ] } } ], "variable": [ { "key": "base_url", "value": "http://localhost:8080", "type": "string" } ] } |
...
Erasure coding protects data from drive failures by splitting and storing data across multiple drives.
Steps:
...
Info | |||||
---|---|---|---|---|---|
Create the Docker Volumes (if not created yet):Before running the modified command, ensure that you have created the Docker volumes if they don't exist:
|
...
|
...
Simulate a disk failure by stopping one volume:
...
After running the command, MinIO will be using the Docker volumes instead of local disk directories for its data storage. |
Modify the Docker setup to enable erasure coding:
Code Block language powershell docker run -p 9000:9000 -p 9001:9001 \ -e "MINIO_ROOT_USER=YOUR_ACCESS_KEY" \ -e "MINIO_ROOT_PASSWORD=YOUR_SECRET_KEY" \ --name minio \ -v minio_volume1:/data1 \ -v minio_volume2:/data2 \ -v minio_volume3:/data3 \ -v minio_volume4:/data4 \ -v $(pwd)/config:/root/.minio \ minio/minio server /data1 /data2 /data3 /data4 --console-address ":9001"
Simulate a disk failure by stopping one volume:
Info | ||||
---|---|---|---|---|
Steps for Simulating the Disk Failure:
|
Code Block Go to Files tab into minio container select the data volume, right click and delete it
Test file uploads/downloads using the existing Spring Boot APIs to observe no data loss.
Info |
---|
Command Structure:1. |
...
2. Bitrot Protection
MinIO uses checksums to detect and repair corrupted data.
...