MinIO 是一种高性能、S3 兼容的对象存储。
官方资料
- 中国官网
- 代码仓库
- 安装和部署MinIO
- 管理现有的MinIO部署
- 核心运营概念
- 监控和警报
- 外部身份管理
- 数据加密(SSE)
- 网络加密(TLS)
- 部署检查清单
- 硬件故障和恢复办法
- 故障排除
- MinIO客户端
- MinIO Admin Client
- MinIO服务器命令介绍
安装MinIO服务器,执行如下命令。
mkdir -p ~/software/minio
cd ~/software/minio
mkdir -p data
mkdir -p config
wget https://dl.minio.org.cn/server/minio/release/linux-amd64/minio
chmod +x minio
启动MinIO服务,执行如下命令。
export MINIO_ROOT_USER=admin
export MINIO_ROOT_PASSWORD=admin1234
./minio server ~/software/minio/data \
--console-address ":9001" \
--config-dir ~/software/minio/config
控制台的输出,如下:
Formatting 1st pool, 1 set(s), 1 drives per set.
WARNING: Host local has more than 0 drives of set. A host failure will result in data becoming unavailable.
MinIO Object Storage Server
Copyright: 2015-2023 MinIO, Inc.
License: GNU AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html>
Version: RELEASE.2023-11-20T22-40-07Z (go1.21.4 linux/amd64)
Status: 1 Online, 0 Offline.
S3-API: http://192.168.0.109:9000 http://127.0.0.1:9000
RootUser: admin
RootPass: admin1234
Console: http://192.168.0.109:9001 http://127.0.0.1:9001
RootUser: admin
RootPass: admin1234
Command-line: https://min.io/docs/minio/linux/reference/minio-mc.html#quickstart
$ mc alias set 'myminio' 'http://192.168.0.109:9000' 'admin' 'admin1234'
Documentation: https://min.io/docs/minio/linux/index.html
Warning: The standard parity is set to 0. This can lead to data loss.
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ You are running an older version of MinIO released 3 weeks before the latest release ┃
┃ Update: Run `mc admin update` ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
安装MinIO
客户端,执行如下命令:
cd ~/software/minio
wget https://dl.minio.org.cn/client/mc/release/linux-amd64/mc
chmod +x mc
创建一个别名,执行如下命令:
./mc alias set 'myminio' 'http://192.168.0.109:9000' 'admin' 'admin1234'
控制台的输出,如下:
mc: Configuration written to `/home/jackie/.mc/config.json`. Please update your access credentials.
mc: Successfully created `/home/jackie/.mc/share`.
mc: Initialized share uploads `/home/jackie/.mc/share/uploads.json` file.
mc: Initialized share downloads `/home/jackie/.mc/share/downloads.json` file.
Added `myminio` successfully.
查看mc
的帮助,执行如下命令:
./mc -help
控制台的输出,如下:
NAME:
mc - MinIO Client for object storage and filesystems.
USAGE:
mc [FLAGS] COMMAND [COMMAND FLAGS | -h] [ARGUMENTS...]
COMMANDS:
alias manage server credentials in configuration file
ls list buckets and objects
mb make a bucket
rb remove a bucket
cp copy objects
mv move objects
rm remove object(s)
mirror synchronize object(s) to a remote site
cat display object contents
head display first 'n' lines of an object
pipe stream STDIN to an object
find search for objects
sql run sql queries on objects
stat show object metadata
tree list buckets and objects in a tree format
du summarize disk usage recursively
retention set retention for object(s)
legalhold manage legal hold for object(s)
support support related commands
license license related commands
share generate URL for temporary access to an object
version manage bucket versioning
ilm manage bucket lifecycle
quota manage bucket quota
encrypt manage bucket encryption config
event manage object notifications
watch listen for object notification events
undo undo PUT/DELETE operations
anonymous manage anonymous access to buckets and objects
tag manage tags for bucket and object(s)
diff list differences in object name, size, and date between two buckets
replicate configure server side bucket replication
admin manage MinIO servers
idp manage MinIO IDentity Provider server configuration
update update mc to latest release
ready checks if the cluster is ready or not
ping perform liveness check
od measure single stream upload and download
batch manage batch jobs
GLOBAL FLAGS:
--autocompletion install auto-completion for your shell
--config-dir value, -C value path to configuration folder (default: "/home/jackie/.mc") [$MC_CONFIG_DIR]
--quiet, -q disable progress bar display [$MC_QUIET]
检查MinIO
服务,执行如下命令:
./mc ping myminio
控制台的输出,如下:
1: http://192.168.0.109:9000:9000 min=1.55ms max=1.55ms average=1.55ms errors=0 roundtrip=1.55ms
2: http://192.168.0.109:9000:9000 min=0.73ms max=1.55ms average=1.14ms errors=0 roundtrip=0.73ms
3: http://192.168.0.109:9000:9000 min=0.39ms max=1.55ms average=0.89ms errors=0 roundtrip=0.39ms
4: http://192.168.0.109:9000:9000 min=0.39ms max=1.55ms average=0.83ms errors=0 roundtrip=0.65ms
5: http://192.168.0.109:9000:9000 min=0.39ms max=1.55ms average=0.78ms errors=0 roundtrip=0.60ms
6: http://192.168.0.109:9000:9000 min=0.39ms max=1.55ms average=0.75ms errors=0 roundtrip=0.62ms
检查别名的配置,执行如下命令:
./mc admin info myminio
控制台的输出,如下:
● 192.168.0.109:9000
Uptime: 2 minutes
Version: 2023-11-20T22:40:07Z
Network: 1/1 OK
Drives: 1/1 OK
Pool: 1
Pools:
1st, Erasure sets: 1, Drives per erasure set: 1
1 drive online, 0 drives offline
创建一个桶,执行命令如下:
./mc mb myminio/bkt1
控制台的输出,如下:
Bucket created successfully `myminio/bkt1`.
上传一个文件,执行命令如下:
./mc cp ./minio myminio/bkt1/a1.txt
控制台的输出,如下:
/home/jackie/software/minio/minio: 91.57 MiB / 91.57 MiB ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.78 MiB/s 19s
至此,使用单节点单硬盘方式部署MinIO
即完成,可以开始后续的探索。