通过流水线安装单机MinIO(Ubuntu)

2022-04-28 16:07:32 浏览数 (1)

流水线安装

首先,通过 Y20持续部署 的流水线应用 安装单机MinIO,演示自动安装流程。

视频内容

为了说明流水线的步骤,下面演示手动安装

手动安装

【步骤1】下载 minio

代码语言:javascript复制
wget https://dl.min.io/server/minio/release/linux-amd64/minio

chmod  x minio
sudo mv minio /usr/local/bin/

【步骤2】创建启动服务文件 /etc/systemd/system/minio.service

代码语言:javascript复制
[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
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】配置数据目录(/data/minio)、用户名(admin)、密码(12345678),并启动服务

代码语言:javascript复制
sudo cat <<EOT >> /etc/default/minio
# Volume to be used for MinIO server.
MINIO_VOLUMES="/data/minio"
# Use if you want to run MinIO on a custom port.
MINIO_OPTS="--address :9000  --console-address :9001"
# Root user for the server.
MINIO_ROOT_USER=admin
# Root secret for the server.
MINIO_ROOT_PASSWORD=12345678
EOT

sudo mkdir -p /data/minio

sudo systemctl daemon-reload
sudo systemctl enable minio.service
sudo systemctl start minio.service

这样单机MinIO就安装完成了!

0 人点赞