Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Modify the Docker setup to enable erasure coding:

    Code Block
    languagepowershell
    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 /mnt/disk1:/data1 \
    -v /mnt/disk2:/data2 \
    -v /mnt/disk3:/data3 \
    -v /mnt/disk4:/data4 \
    minio/minio server /data1 /data2 /data3 /data4
  2. Simulate a disk failure by stopping one volume:

    Code Block
    docker stop /mnt/disk1
  3. Test file uploads/downloads using the existing Spring Boot APIs to observe no data loss.

Info

Command Structure:

1. docker run:

Runs a container from a Docker image.

2. -p 9000:9000 -p 9001:9001:

Maps ports on the host to ports in the container:

  • 9000:9000 → Maps the host's port 9000 to the container's port 9000 (used for the MinIO API).

  • 9001:9001 → Maps the host's port 9001 to the container's port 9001 (used for the MinIO web console).

3. -e "MINIO_ROOT_USER=YOUR_ACCESS_KEY":

Sets the environment variable MINIO_ROOT_USER inside the container to YOUR_ACCESS_KEY. This is the access key for authentication.

4. -e "MINIO_ROOT_PASSWORD=YOUR_SECRET_KEY":

Sets the environment variable MINIO_ROOT_PASSWORD inside the container to YOUR_SECRET_KEY. This is the secret key for authentication.

5. --name minio:

Assigns the name minio to the container. You can reference the container by this name for future commands.

6. -v /mnt/disk1:/data1 to -v /mnt/disk4:/data4:

Mounts the host's directories (/mnt/disk1, /mnt/disk2, etc.) to directories in the container (/data1, /data2, etc.). These are storage volumes for MinIO.

7. minio/minio:

Specifies the Docker image to use, which in this case is the official MinIO image.

8. server /data{1...4}:

  • Runs the MinIO server in distributed mode, using the specified directories (/data1, /data2, /data3, /data4) as storage locations.

  • The {1...4} syntax expands to /data1 /data2 /data3 /data4.


Summary:

This command starts a MinIO server in distributed mode with:

  1. Two exposed ports (9000 for API, 9001 for the web console).

  2. Authentication credentials provided via environment variables.

  3. Four storage volumes mapped from host directories.

  4. The MinIO container named minio.

...

2. Bitrot Protection

MinIO uses checksums to detect and repair corrupted data.

...