---
title: 部署MinIO
description: "以下操作四个节点均需执行。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengsdss/ecosystemEnable/MinIO/openmind_kunpengminio_04_0004.html
sourcePath: /source/zh/kunpengsdss/ecosystemEnable/MinIO/openmind_kunpengminio_04_0004.html
indexId: 751d8ca5a1c5204dae3623e8e80a0f820762ece3513595ff6c0411e5a8814be379
---
# 部署MinIO

以下操作四个节点均需执行。

1. 创建安装目录。
  1 mkdir -p /opt/minio/{run,data} && mkdir -p /etc/minio

2. 将MinIO安装包下载到“/opt/minio/run”。
  1 2 cd /opt/minio/run wget https://dl.min.io/server/minio/release/linux-arm64/archive/minio.RELEASE.2020-12-12T08-39-07Z

3. 配置启动文件。
  1 vim /opt/minio/run/run.sh

  添加以下内容。

  1 2 3 4 5 6 7 8 #!/bin/bash export MINIO_ACCESS_KEY=admin export MINIO_SECRET_KEY=hpc8912011 /opt/minio/run/minio.RELEASE.2020-12-12T08-39-07Z server --config-dir /etc/minio \ http://192.168.122.2/opt/minio/data \ http://192.168.122.3/opt/minio/data \ http://192.168.122.4/opt/minio/data \ http://192.168.122.5/opt/minio/data

  MinIO默认9000端口。 MINIO_ACCESS_KEY：用户名，长度最小是5个字符。 MINIO_SECRET_KEY：密码，密码不能设置过于简单，否则MinIO会启动失败，长度最小是8个字符。 –config-dir：指定集群配置文件目录。 IP地址请根据实际情况配置。

4. 创建“minio.server”文件。
  1 vim /usr/lib/systemd/system/minio.service

  添加以下内容。

  1 2 3 4 5 6 7 8 9 10 11 12 13 [Unit] Description=Minio service Documentation=https://docs.minio.io/ [Service] WorkingDirectory=/opt/minio/run/ ExecStart=/opt/minio/run/run.sh Restart=on-failure RestartSec=5 [Install] WantedBy=multi-user.target

5. 修改权限。
  1 chmod +x /usr/lib/systemd/system/minio.service && chmod +x /opt/minio/run/minio.RELEASE.2020-12-12T08-39-07Z && chmod +x /opt/minio/run/run.sh

6. 启动MinIO集群。
  1 2 3 systemctl daemon-reload systemctl start minio systemctl enable minio

7. 查看集群状态。
  1 systemctl status minio.service

  出现active (running)即表示启动成功。
