MinIO 安装
Docker安装
#9001为web界面端口,9000为程序通信端口
docker run -d \
--name minio \
-p 9000:9000 \
-p 9001:9001 \
--privileged=true \
-e "MINIO_ROOT_USER=admin" \
-e "MINIO_ROOT_PASSWORD=admin123" \
--restart=always \
--privileged=true \
-v ~/minio/data:/data \
-v ~/minio/config:/root/.minio \
minio/minio server /data \
包管理器安装
在手册里有包管理器安装相关信息
DEB (Debian/Ubuntu)
wget https://dl.min.io/server/minio/release/linux-amd64/archive/minio_20240628090649.0.0_amd64.deb -O minio.deb
sudo dpkg -i minio.deb
RPM (RHEL)
wget https://dl.min.io/server/minio/release/linux-amd64/archive/minio-20240628090649.0.0-1.x86_64.rpm -O minio.rpm
sudo dnf install minio.rpm
二进制包安装
下载二进制包
wget https://dl.min.io/server/minio/release/linux-amd64/minio
chmod +x minio
sudo mv minio /usr/local/bin/
配置用户和进程守护
MinIO 在启动时预分配 2GiB 的系统内存。
创建 minio-user
用户和用户组,并给存放minio数据的目录权限
groupadd -r minio-user
useradd -M -r -g minio-user minio-user
chown minio-user:minio-user /mnt/disk1
编写systemd 配置文件
vim /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})
创建 Linux 环境变量
# MINIO_ROOT_USER 和 MINIO_ROOT_PASSWORD 用来设置 root 用户的账号密码。
# 默认值是 'minioadmin:minioadmin'.
MINIO_ROOT_USER=myminioadmin
MINIO_ROOT_PASSWORD=minio-secret-key-change-me
# MINIO_VOLUMES 用来设置存放数据的目录
MINIO_VOLUMES="/mnt/data"
# 该选项是用来设置web界面的端口
MINIO_OPTS="--console-address :9001"
启动 MinIO 服务
用出以下命令以启动 MinIO:
sudo systemctl start minio.service
使用以下命令确认服务是否正常运行:
sudo systemctl status minio.service
journalctl -f -u minio.service
预期输出
Status: 1 Online, 0 Offline.
API: http://192.168.2.100:9000 http://127.0.0.1:9000
RootUser: myminioadmin
RootPass: minio-secret-key-change-me
Console: http://192.168.2.100:9001 http://127.0.0.1:9001
RootUser: myminioadmin
RootPass: minio-secret-key-change-me
Command-line: https://min.io/docs/minio/linux/reference/minio-mc.html
$ mc alias set myminio http://10.0.2.100:9000 myminioadmin minio-secret-key-change-me
Documentation: https://min.io/docs/minio/linux/index.html
设置开机启动:
sudo systemctl enable minio.service
连接到 minio
使用web界面控制:
您可以通过在浏览器输入 http://localhost:9001
使用控制台命令
参考文档 https://min.io/docs/minio/linux/reference/minio-mc.html#mc-install
mc alias set http://localhost:9000 myminioadmin minio-secret-key-change-me