MinIO
2024-09-23MinIO 是个基于 Golang 编写的开源对象存储服务,存储非结构化数据,如:图片,视频,音乐等
https://min.io/
在minio中有两个比较重要的概念:桶和对象,即(bucket和object)。桶是存放对象的顶级容器,通俗来是桶就是我们平时熟悉的文件夹,对象就是文件,文件夹里面存放文件,那桶里面存放对象也就更容易理解了。
1、docker pull minio/minio
docker run -p 9000:9000 -p 9099:9099 \
--net=bridge \
--name minio \
-d --restart=always \
-e "MINIO_ACCESS_KEY=fsp-manage" \
-e "MINIO_SECRET_KEY=springboot-fsp-manage" \
-v /home/minio/data:/data \
-v /home/minio/config:/root/.minio \
minio/minio server \
/data --console-address ":9099" -address ":9000"
http://serverUrl:9099/login
2、curl -o /usr/local/bin/minio https://dl.min.io/server/minio/release/linux-amd64/minio
sudo chmod +x /usr/local/bin/minio
minio --version
useradd -r minio -s /sbin/nologin
cat << EOF > /etc/default/minio
MINIO_ROOT_USER="minio"
MINIO_VOLUMES="/minio-data"
MINIO_OPTS="-C /etc/minio --address :9080 --console-address :9081"
MINIO_ROOT_USER=admin
MINIO_ROOT_PASSWORD=ABcd12##
EOF
chown minio:minio /etc/default/minio
sudo mkdir -p /minio-data
sudo chown -R minio:minio /minio-data
cat << EOF > /lib/systemd/system/minio.service
[Unit]
Description=Minio
Documentation=https://docs.minio.io
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/usr/local/bin/minio
[Service]
WorkingDirectory=/usr/local/
User=minio
Group=minio
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
Restart=always
LimitNOFILE=65536
TimeoutStopSec=infinity
SendSIGKILL=no
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl start minio
sudo systemctl enable minio