network-programmingvirtual-machineminiodata-lakeminio-client

"Insufficient number of drives online" error when running distributed MinIO in virtual machines


I'm having trouble starting the MinIO service in a distributed setting across 2 virtual machines (not Docker). I'm encountering a Error: Read failure. Insufficient number of drives online. Waiting for a minimum of 4 drives to come online when running sudo systemctl start minio.service

I first added both the VMs IPs to the /etc/hosts file

127.0.0.1 localhost
127.0.1.1 vagrant
192.XXX.XXX.58  minio-01.example.com
192.XXX.XXX.116 minio-02.example.com

I then created virtual hard disks using this method here and this is my lsblk output. Using loop0 to loop3's mount points

NAME     MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0    7:0     0  4G   0  loop /mnt/disk1
loop1    7:0     0  4G   0  loop /mnt/disk2
loop2    7:0     0  4G   0  loop /mnt/disk3
loop3    7:0     0  4G   0  loop /mnt/disk4

permissions in /mnt

drwxr-xr-x 3 minio-user minio-user disk1/
drwxr-xr-x 3 minio-user minio-user disk2/
drwxr-xr-x 3 minio-user minio-user disk3/
drwxr-xr-x 3 minio-user minio-user disk4/

I then followed the tutorial provided by MinIO for distributed deployment (Multi-node Multi-drive) and these are my files:

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

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

[Service]
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

# MinIO RELEASE.2023-05-04T21-44-30Z adds support for Type=notify (https://www.freedesktop.org/software/systemd/man/systemd.service.html#Type=)
# This may improve systemctl setups where other services use `After=minio.server`
# Uncomment the line to enable the functionality
# Type=notify

# Let systemd restart this service always
Restart=always

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

# 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})

/etc/default/minio

MINIO_VOLUMES="http://minio-0{1...2}.example.com:9000/mnt/disk{1...4}"
MINIO_OPTS="--console-address :9001"
MINIO_ROOT_USER=minioadmin
MINIO_ROOT_PASSWORD=miniocluster
MINIO_SERVER_URL="http://minio-01.example.com:9000"

After running the sudo systemctl start minio.service I encountered this error

MinIO error - journalctl -f -u minio.service

I am unsure how to proceed since I believe I have already added the right permissions to each mount point and followed the tutorial provided by MinIO themselves. Any help is appreciated. Thank you.

I am expecting the MinIO service to pass through and able to access the platform on port :9000


Solution

  • Figured out the issue. Nothing wrong with the configuration, just needed to start both servers at the same time in order to detect the drives.