以下是在CentOS上安装MinIO的步骤:
sudo yum update -y
sudo yum install -y wget unzip
wget https://dl.min.io/server/minio/release/linux-amd64/minio
sudo mkdir -p /data/minio/{data,log}
sudo chown -R $(whoami):$(whoami) /data/minio
sudo vim /etc/default/minio
添加内容:MINIO_VOLUMES="/data/minio/data"
MINIO_OPTS="--address :9000"
MINIO_ROOT_USER="minioadmin"
MINIO_ROOT_PASSWORD="minioadmin"
sudo vim /etc/systemd/system/minio.service
内容如下:[Unit]
Description=MinIO
Documentation=https://docs.min.io
Wants=network-online.target
After=network-online.target
[Service]
User=$(whoami)
Group=$(whoami)
EnvironmentFile=/etc/default/minio
ExecStart=/usr/local/bin/minio server $MINIO_OPTS $MINIO_VOLUMES
Restart=always
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl start minio
sudo systemctl enable minio
wget https://dl.min.io/client/mc/release/linux-amd64/mc
sudo chmod +x mc
sudo mv mc /usr/local/bin/
./mc alias set myminio http://localhost:9000 minioadmin minioadmin
./mc ls myminio
/etc/default/minio文件,设置不同的数据目录和访问密钥等,确保MINIO_VOLUMES指向正确的数据存储位置。