部署单节点minio
部署单节点minio
一、下载
https://min.io/download#/linux
二、安装
CentOS系统可下载rpm包并安装
rpm -ivh minio-20220401034139.0.0.x86_64.rpm三、配置
3.1修改minio.service,路径为/etc/systemd/system/
[Unit]
Description=MinIO
Documentation=https://docs.min.io
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/usr/local/bin/minio
[Service]
WorkingDirectory=/usr/local
User=root
Group=root
#修改执行用户,默认为minio-user,可修改为root或者建立对应的用户。
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})
3.2 配置文件
默认启动指定的的配置文件路径为/etc/default/minio
创建文件并设置:
MINIO_VOLUMES="/opt/minio/data"
#数据存储目录
MINIO_OPTS="--address :9000 --console-address :9100"
#API端口使用9000;
#dashboard端口使用9100,若此处不指定,则使用随机端口。
MINIO_ACCESS_KEY=minio
#登录用户名
MINIO_SECRET_KEY=zFd4D07G02klaUVxilRmcISs
#登录用户密码
MINIO_REGION_NAME="epms_minio"
#区域名
MINIO_SERVER_URL="https://minio.example.com:9000"
#域名,这里使用api接口的端口,而非控制台端口四、启动
systemctl daemon-reload
systemctl start minio && systemctl enable minio控制台访问地址
http://0.0.0.0:9000
如果指定了控制台端口,则直接访问指定的端口。
如果没有指定控制台的端口,直接访问接口端口(默认9000),则会跳转到控制台。
五、配置https
将证书上传到目录:/root/.minio/cert/
密钥与证书分别命名为:private.key和public.crt
systemctl restart minio
#重启minio服务需要在配置文件中配置好监听的域名(见上文配置文件)
MINIO_SERVER_URL="https://minio.example.com:9000"