Minio集群模式报错解决:Unable to use the drive XXX: drive not found, will be retried

Minio集群模式报错解决:Unable to use the drive XXX: drive not found, will be retried

部署环境说明

节点共规划出四个节点,并且已经进行安装部署

虚拟机名称虚拟机IP主机名磁盘挂载
centos7_01192.168.0.123minio-01/dev/sdb /mnt/data1
centos7_02192.168.0.136minio-02/dev/sdb /mnt/data1
centos7_03192.168.0.141minio-03/dev/sdb /mnt/data1
centos7_04192.168.0.163minio-04/dev/sdb /mnt/data1

而且使用脚本启动是可以正常访问

export MINIO_ROOT_USER=minio
export MINIO_ROOT_PASSWORD=miniostorage
nohup minio server --config-dir /etc/minio --address ":9000" --console-address ":9001" \
http://minio-01/mnt/data1 http://minio-02/mnt/data1 \
http://minio-03/mnt/data1 http://minio-04/mnt/data1 > minio_server.log 2>&1 &

image-20250220103641941

问题描述

在参考官网将minio启动作为服务文件时,按照创建服务文件systemd创建服务环境文件进行配置后执行启动

sudo systemctl start minio.service

发现报错如下:

[root@minio-04 system]# journalctl -f -u minio.service
-- Logs begin at 四 2025-02-20 19:44:20 CST. --
221 15:53:47 minio-04 minio[54538]: INFO: Unable to use the drive http://minio-01:9000/mnt/data1: drive not found, will be retried
221 15:53:47 minio-04 minio[54538]: INFO: Unable to use the drive http://minio-02:9000/mnt/data1: drive not found, will be retried
221 15:53:47 minio-04 minio[54538]: INFO: Unable to use the drive http://minio-03:9000/mnt/data1: drive not found, will be retried
221 15:53:47 minio-04 minio[54538]: INFO: Unable to use the drive http://minio-04:9000/mnt/data1: drive not found, will be retried
221 15:53:47 minio-04 minio[54538]: INFO: Waiting for a minimum of 2 drives to come online (elapsed 1m25s)
221 15:53:48 minio-04 minio[54538]: INFO: Unable to use the drive http://minio-01:9000/mnt/data1: drive not found, will be retried
221 15:53:48 minio-04 minio[54538]: INFO: Unable to use the drive http://minio-02:9000/mnt/data1: drive not found, will be retried
221 15:53:48 minio-04 minio[54538]: INFO: Unable to use the drive http://minio-03:9000/mnt/data1: drive not found, will be retried
221 15:53:48 minio-04 minio[54538]: INFO: Unable to use the drive http://minio-04:9000/mnt/data1: drive not found, will be retried
221 15:53:48 minio-04 minio[54538]: INFO: Waiting for a minimum of 2 drives to come online (elapsed 1m26s)

问题分析

官网给出的赋权操作语句如下:

image-20250221160645356

注意,这里仅仅是给 磁盘赋权 ,而不是递归赋权给所有子目录!也就是说当前的数据目录下不能有bucket和文件!

验证数据目录无数据启动:

已经执行了此操作

image-20250221162012384

# 先恢复权限给root
chown -R root:root /mnt/data1 
# 给磁盘赋权
chown minio-user:minio-user /mnt/data1

image-20250221161052368

重启四台机器的服务,发现可以正常启动

sudo systemctl restart minio.service

image-20250221162037840

验证数据目录有数据启动:

上面的操作成功后,新建了test的桶和上传了一个文件

image-20250221163042229

停止服务

sudo systemctl stop minio.service

然后和上面一样操作进行赋权

# 先恢复权限给root
chown -R root:root /mnt/data1 
# 给磁盘赋权
chown minio-user:minio-user /mnt/data1

重启四台机器的服务,发现启动是成功的,但是无法访问客户端

sudo systemctl restart minio.service

image-20250221163313401

查看报错信息:

journalctl -f -u minio.service

image-20250221163356420

解决方案:注意赋权加了 -R

# 给磁盘赋权
chown -R minio-user:minio-user /mnt/data1

直接访问成功!

image-20250221163520223

问题总结

数据目录为空时的解决方案

当数据目录为空时,确保 MinIO 用户有足够权限访问磁盘目录。执行以下命令:

# 赋权给 MinIO 用户
sudo chown minio-user:minio-user /mnt/data1

# 重启 MinIO 服务
sudo systemctl restart minio.service

数据目录已有数据时的解决方案

当数据目录已经包含数据(例如桶和文件),需要递归地赋予 MinIO 用户权限。执行以下命令:

# 递归地为数据目录下的所有文件和子目录赋权给 MinIO 用户
sudo chown -R minio-user:minio-user /mnt/data1

# 重启 MinIO 服务
sudo systemctl restart minio.service

执行以下命令查看服务状态:

# 查看 MinIO 服务状态
sudo systemctl status minio.service

# 查看日志,确保没有权限相关错误
journalctl -f -u minio.service
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

徐州蔡徐坤

又要到饭了兄弟们

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值