Linux 服务器上简单配置 minio
-
初始化结构目录
mkdir -p /data/minio/bin
mkdir -p /data/minio/conf
mkdir -p /data/minio/data
-
下载 minio
cd /data/minio/bin
curl -O https://dl.min.io/server/minio/release/linux-amd64/minio
添加执行权限
chmod +x minio
-
创建配置文件 minio.conf
cd /data/minio/conf
touch minio.conf
添加如下内容:
MINIO_VOLUMES="/data/minio/data" MINIO_OPTS="-C /data/minio/conf --console-address :9001 --address :9000" MINIO_ACCESS_KEY="minio" MINIO_SECRET_KEY="minio@admin"
数据添加到 data 文件夹下
web 管理页面启动到 9001 端口,登录账号 minio,登录密码 minio@admin
服务启动到 9000 端口
-
创建 minio 用户
groupadd minio
useradd minio -g minio
修改文件夹所有者
cd /data
chown -R minio:minio minio
-
创建 minio.service 服务
touch /etc/systemd/system/minio.service
添加如下内容:
[Unit] Description=MinIO Documentation=https://docs.min.io Wants=network-online.target After=network-online.target AssertFileIsExecutable=/data/minio/bin/minio [Service] # User and group User=minio Group=minio EnvironmentFile=/data/minio/conf/minio.conf ExecStart=/data/minio/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=65536 # Disable timeout logic and wait until process is stopped TimeoutStopSec=infinity SendSIGKILL=no [Install] WantedBy=multi-user.target
启动并测试服务状态
systemctl status minio.service systemctl start minio.service systemctl status minio.service
设置为开机自启动
systemctl enable minio.service
查看服务日志
journalctl -u minio.service
停止服务
systemctl stop minio.service