资源准备
minio二进制包
下载地址:https://dl.min.io/server/minio/release/linux-amd64/minio
ubuntu-单节点部署
选择一台ubuntu18.04机器10.253.9.41、intel 或者 amd 64位处理器
上传minio到~目录
sudo cp minio /usr/local/bin/
sudo chmod +x /usr/local/bin/minio
设置存储对象位置
sudo mkdir -p /home/minio/data
chmod 755 -R /home/minio/data
启动
cd /usr/local/bin/
./minio server /home/minio/data
ERROR Unable to start the server: Specified port is already in use
指定端口启动
./minio server --address ":9300" /home/minio/data/
设置开机自启
创建 systemd 系统启动服务文件
vi /usr/lib/systemd/system/minio.service
如果没有system这个目录,需要mkdir 这个目录,然后在去vi创建这个文件。
服务必须全部设置开机自启,如果遇到停电情况,没有开机自启,又没做监控告警,没人运维,那服务不就bug了,加自启免运维。
加入以下配置
[Unit]
Description=MinIO
After=network.target
AssertFileIsExecutable=/usr/local/bin/minio
[Service]
WorkingDirectory=/usr/local/bin/
EnvironmentFile=/home/minio/conf/mino
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 (systemd.service)
# 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})
添加配置文件
mkdir -p /home/minio/conf
vi /home/minio/conf/mino
#登录名称账号和密码
MINIO_ROOT_USER=myminioadmin
MINIO_ROOT_PASSWORD=sa123456
#数据目录
MINIO_VOLUMES="/home/minio/data/"
#第一个是web页面地址,第二个是api地址
MINIO_OPTS="--address :9299 --console-address :9300"
使服务生效
# 重新加载服务配置文件,使服务生效
systemctl daemon-reload# 将服务设置为开机启动
systemctl enable minio# 服务立即启动
systemctl start minio# 查看minio服务当前状态
systemctl status minio