MinIO 是一个高性能的对象存储,原生支持 Kubernetes 部署的解决方案。 MinIO也提供了一个 Amazon Web Services S3 兼容 API 并支持所有核心 S3 功能。
文件不切片的MinIO
部署Minio
1 2 3 4 5 6 7 8 9
| $ mkdir -p /data1/release /data/minio /data2/minio-data $ cd /data1/release $ wget -c 'https://dl.min.io/server/minio/release/linux-amd64/archive/minio.RELEASE.2021-02-14T04-01-33Z' $ wget -c "https://dl.min.io/client/mc/release/linux-amd64/mc" $ mv minio.RELEASE.2021-02-14T04-01-33Z /data/minio/minio $ mv mc /data/minio/ $ cd /data/minio $ chmod +x minio mc
|
授权
1 2 3 4
| $ groupadd -r minio-user $ useradd -M -r -g minio-user minio-user $ chown -R minio-user:minio-user /data/minio /data2/minio-data $ chmod u+rxw /data2/minio-data
|
minio配置文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| $ cd /data/minio $ cat minio.env MINIO_ROOT_USER="minioroot" MINIO_ROOT_PASSWORD="password" MINIO_STORAGE_CLASS_STANDARD="4" MINIO_STORAGE_CLASS_RRS="2" MINIO_VOLUMES="/data4/minio-data" MINIO_OPTS="--address 10.73.9.3:9199"
|
minio-server启动配置文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| $ cat /etc/systemd/system/minio-server.service [Unit] Description=MinIO Documentation=https://docs.min.io Wants=network-online.target After=network-online.target AssertFileIsExecutable=/data/minio/minio [Service] WorkingDirectory=/data/minio/ User=minio-user Group=minio-user EnvironmentFile=/data/minio/minio.env ExecStartPre=/bin/bash -c "if [ -z \"${MINIO_VOLUMES}\" ]; then echo \"Variable MINIO_VOLUMES not set in /etc/default/minio\"; exit 1; fi" ExecStart=/data/minio/minio server $MINIO_OPTS $MINIO_VOLUMES Restart=always LimitNOFILE=1048576 TasksMax=infinity TimeoutStopSec=infinity SendSIGKILL=no [Install] WantedBy=multi-user.target
|
启动minio-server
1 2 3
| $ systemctl daemon-reload $ systemctl start minio-server $ systemctl status minio-server -l
|
配置haproxy
1 2 3 4 5 6 7 8 9 10 11 12
| frontend http-sgim-minio-data bind *:9800 option forwardfor except 127.0.0.1 option http-server-close option httplog option dontlognull default_backend sgim-minio-data maxconn 5000000 backend sgim-minio-data balance leastconn server minio-test1 10.73.9.3:9199 maxconn 1000000
|
设置MinIO Client(mc)
1 2 3 4 5 6 7 8
| $ cd /data/minio $ ./mc ls #初始化mc $ ./mc alias set minioTest // Added `` $ ./mc mb minioTest/test 创建 $ ./mc cp file minioTest/test 上传文件到 $ ./mc ls minioTest/test 查看/test文件列表
|
验证文件是否被切片
登陆Minio Server的服务器
1 2 3 4 5 6
| $ cd /data4/minio-data $ tree test/ test/ └── telegraf-1.22.4-1.x86_64.rpm 0 directories, 1 file
|
访问minio-Server Web
http://ip:9800/minio/login
账号密码为,在minio.env配置文件里设置的MINIO_ROOT_USER
和MINIO_ROOT_PASSWORD
的值
MinIO权限管理
MinIO Console
→ Access
→ Create Policy
→ Write Policy
意思是,只能控制test bucket
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:GetObject", "s3:ListAllMyBuckets", "s3:ListBucket", "s3:PutObject", "s3:DeleteObject", "s3:GetBucketLocation" ], "Resource": [ "arn:aws:s3:::test/*" ] } ] }
|
Minio旧版本Binary下载地址:https://dl.min.io/server/minio/release/linux-amd64/archive/
官网:http://www.minio.org.cn/download.shtml#/linux
本文出自”Jack Wang Blog”:http://www.yfshare.vip/2022/11/07/部署文件不切片的Minio-Server/