Skip to main content

Instalar MinIO

MinIO es un servicio de almacenamiento en la nube compatible con Amazon S3, liberado bajo Licencia Apache v2.

MinIO permite establecer un sistema distribuido con alta disponibilidad gestionando diferentes servidores con diferentes almacenamientos como un sólo sistema de almacenamiento.

MinIO permite almacenar datos en formato archivo (como datos desestructurados  fotos, vídeos, archivos de registro, copias de seguridad e imágenes de contenedor)

El tamaño máximo de un objeto es 50TB.

Instalación de MinIO en Debian

En primer lugar, instalaremos wget si no está instalado

apt install wget

Después descargaremos el archivo deb del repositorio de MinIO.

wget https://dl.min.io/server/minio/release/linux-amd64/archive/minio_20230930070229.0.0_amd64.deb -O minio.deb

Y una procedido a la descarga, lo instalaremos

dpkg -i minio.deb

Configuración de MinIO

Agregamos un grupo para el servicio de MinIO

groupadd -r minio-user

Agregamos un usuario también

useradd -M -r -g minio-user minio-user

Establecemos permisos en la carpeta o en el disco de almacenamiento (en nuestro ejemplo hemos montado en el punto de montaje /mnt/minio

chown minio-user:minio-user /mnt/minio

El paquete de instalación nos configurará el servicio de minio para poder ejecutarlo, lo comprobamos viendo el fichero del servicio.

cat /usr/lib/systemd/system/minio.service

Comprobaremos que los valores son correctos (usuario y grupo del servicio)

[Unit]
Description=MinIO
Documentation=https://docs.min.io
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/usr/local/bin/minio

[Service]
Type=notify

WorkingDirectory=/usr/local

User=minio-user
Group=minio-user
ProtectProc=invisible

EnvironmentFile=-/etc/default/minio
ExecStartPre=/bin/bash -c "if [ -z \"${MINIO_VOLUMES}\" ]; then echo \"Variable MINIO_VOLUMES not set in /etc/default/minio\"; exit 1; fi"
ExecStart=/usr/local/bin/minio server $MINIO_OPTS $MINIO_VOLUMES

# Let systemd restart this service always
Restart=always

# Specifies the maximum file descriptor number that can be opened by this process
LimitNOFILE=1048576

# Specifies the maximum number of threads this process can create
TasksMax=infinity

# Disable timeout logic and wait until process is stopped
TimeoutStopSec=infinity
SendSIGKILL=no

[Install]
WantedBy=multi-user.target

# Built for ${project.name}-${project.version} (${project.name})

Editamos el fichero de configuración de MinIO para ajustar los parámetros a nuestro sistema.

nano /etc/default/minio

Y configuramos nuestro MinIO. En este ejemplo hemos configurado los siguientes parámetros

MINIO_ROOT_USER=minioadmin
MINIO_ROOT_PASSWORD=miniopassword

Ambos valores están puestos a efectos de esta Wiki, recomendamos usar unos valores para el usuario y la password más seguros

MINIO_VOLUMES="/mnt/minio"

Es la carpeta o el disco en el que MinIO va a almacenar los datos.

MINIO_SERVER_URL="http://10.200.3.191:9000"

Es la url del portal de administración de MinIO.

# MINIO_ROOT_USER and MINIO_ROOT_PASSWORD sets the root account for the MinIO server.
# This user has unrestricted permissions to perform S3 and administrative API operations on any resource in the deployment.
# Omit to use the default values 'minioadmin:minioadmin'.
# MinIO recommends setting non-default values as a best practice, regardless of environment

MINIO_ROOT_USER=minioadmin
MINIO_ROOT_PASSWORD=miniopassword

# MINIO_VOLUMES sets the storage volume or path to use for the MinIO server.

MINIO_VOLUMES="/mnt/minio"

# MINIO_SERVER_URL sets the hostname of the local machine for use with the MinIO Server
# MinIO assumes your network control plane can correctly resolve this hostname to the local machine

# Uncomment the following line and replace the value with the correct hostname for the local machine and port for the MinIO server (90>


MINIO_SERVER_URL="http://10.200.3.191:9000"

Por último habilitaremos el servicio para que arranque al inicio y lo iniciaremos

systemctl enable minio
systemctl start minio

El vídeo explicativo del proceso, lo puedes ver en nuestro canal de Youtube.