Skip to content

Commit

Permalink
doc: update docs/minio.md #813
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Aug 19, 2024
1 parent d604a0d commit 58efbde
Show file tree
Hide file tree
Showing 3 changed files with 183 additions and 55 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ Quick Reference
[Spring Boot](./docs/springboot.md)<!--rehype:style=background: rgb(0 149 0);&class=tag&data-lang=Java-->
[Lua](./docs/lua.md)<!--rehype:style=background: rgb(3 3 128);-->
[Pytorch](./docs/pytorch.md)<!--rehype:style=background: rgb(238 76 44);&class=contributing tag&data-lang=Python&data-info=👆看看还缺点儿什么?-->
[Jupyter](./docs/jupyter.md)<!--rehype:style=background: rgb(0 72 153);&class=tag&data-lang=Python-->
[Jupyter](./docs/jupyter.md)<!--rehype:style=background: rgb(0 72 153);&class=tag&data-lang=Python-->
[Minio](./docs/minio.md)<!--rehype:style=background: rgb(3 3 128);-->
<!--rehype:class=home-card-->
[Minio](./docs/minio.md)<!--rehype:style=background: rgb(199 44 72));&class=tag-->

## 配置

Expand Down
2 changes: 1 addition & 1 deletion assets/minio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
232 changes: 180 additions & 52 deletions docs/minio.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MinIO 备忘清单
===

这是 MinIO 语法的快速参考备忘单
这是 MinIO 语法的快速参考备忘单

MinIO 快速参考
----
Expand All @@ -12,7 +12,7 @@ MinIO 快速参考
- **桶(Bucket)**:MinIO中存储对象的容器,类似于文件夹。
- **对象(Object)**:桶中存储的具体数据。

### 安装MinIO
### 安装MinIO

-[MinIO官网](https://min.io/download)下载对应平台的MinIO服务器。
- 根据操作系统的指南进行安装。
Expand All @@ -24,6 +24,7 @@ MinIO 快速参考
```shell
minio server /export/data1 /export/data2 /export/data3 /export/data4
```

- 其中`/export/data1`等是存储数据的路径。

### 访问MinIO
Expand All @@ -32,76 +33,203 @@ MinIO 快速参考
- 使用客户端工具,如`mc`命令行工具。

### minio client 安装
<!--rehype:wrap-class=row-span-2 col-span-2-->

- windows

下载

`https://dl.min.io/client/mc/release/windows-amd64/mc.exe`
#### windows

`\path\to\mc.exe --help`
下载

- mac

安装
```bash
https://dl.min.io/client/mc/release/windows-amd64/mc.exe
\path\to\mc.exe --help
```

#### mac

`brew install minio/stable/mc`
安装

`mc --help`
```bash
brew install minio/stable/mc
mc --help
```

- linux

**版本比较多,请去官网查找安装步骤**

```sh
curl https://dl.min.io/client/mc/release/linux-amd64/mc \
--create-dirs \
-o $HOME/minio-binaries/mc
#### linux

chmod +x $HOME/minio-binaries/mc
export PATH=$PATH:$HOME/minio-binaries/
```
```sh
curl https://dl.min.io/client/mc/release/linux-amd64/mc \
--create-dirs \
-o $HOME/minio-binaries/mc

chmod +x $HOME/minio-binaries/mc
export PATH=$PATH:$HOME/minio-binaries/
```

版本比较多,请去官网查找安装步骤

### mc 连接服务操作

- 列出所有别名:`mc alias list`
- 添加服务别名:`mc alias set myminio https://myminio.example.net minioadminuser minioadminpassword`
- 删除服务别名:`mc alias rm myminio`
列出所有别名

```bash
mc alias list
```

添加服务别名

```bash
mc alias set myminio https://myminio.example.net minioadminuser minioadminpassword
```

删除服务别名

```bash
mc alias rm myminio
```

### mc 桶操作

- 创建桶:`mc mb myminio/mybucket`
- 删除桶:`mc rb myminio/mybucket`
- 设置桶策略:`mc policy set download myminio/mybucket`
- 设置桶生命周期:`mc ilm import myminio/mybucket`
创建桶

```sh
mc mb myminio/mybucket
```

删除桶

```sh
mc rb myminio/mybucket
```

设置桶策略

```sh
mc policy set download myminio/mybucket
```

设置桶生命周期

```sh
mc ilm import myminio/mybucket
```

### mc 文件操作
<!--rehype:wrap-class=row-span-2-->

列出文件

```sh
mc ls myminio/mybucket
```

上传文件

```sh
mc cp /path/to/file myminio/mybucket/file
```

下载文件

- 列出文件:`mc ls myminio/mybucket`
- 上传文件:`mc cp /path/to/file myminio/mybucket/file`
- 下载文件:`mc cp myminio/mybucket/file /path/to/destination`
- 删除文件:`mc rm myminio/mybucket/file`
- 移动文件:`mc mv myminio/mybucket/file myminio/mybucket/newfile`
- 拷贝文件:`mc cp myminio/mybucket/file myminio/mybucket/newfile`
- 查找文件:`mc find myminio/mydata --name "*.jpg"`
```sh
mc cp myminio/mybucket/file /path/to/destination
```

删除文件

```sh
mc rm myminio/mybucket/file
```

移动文件

```sh
mc mv myminio/mybucket/file myminio/mybucket/newfile
```

拷贝文件

```sh
mc cp myminio/mybucket/file myminio/mybucket/newfile
```

查找文件

```sh
mc find myminio/mydata --name "*.jpg"
```

### mc 文件夹操作
<!--rehype:wrap-class=row-span-2-->

列出文件夹

```sh
mc ls myminio/mybucket/folder
```

创建文件夹

```sh
mc mb myminio/mybucket/folder
```

删除文件夹

```sh
mc rb myminio/mybucket/folder
```

- 列出文件夹:`mc ls myminio/mybucket/folder`
- 创建文件夹:`mc mb myminio/mybucket/folder`
- 删除文件夹:`mc rb myminio/mybucket/folder`
- 移动文件夹:`mc mv myminio/mybucket/folder myminio/mybucket/newfolder`
- 拷贝文件夹:`mc cp myminio/mybucket/folder myminio/mybucket/newfolder`
- 删除文件夹中的所有文件:`mc rm --recursive myminio/mybucket/folder`
- 列出文件夹中的所有文件:`mc ls --recursive myminio/mybucket/folder`
- 列出文件夹中的所有文件,包括子文件夹:`mc ls --recursive --include-folders myminio/mybucket/folder`
移动文件夹

```sh
mc mv myminio/mybucket/folder myminio/mybucket/newfolder
```

拷贝文件夹

```sh
mc cp myminio/mybucket/folder myminio/mybucket/newfolder
```

删除文件夹中的所有文件

```sh
mc rm --recursive myminio/mybucket/folder
```

列出文件夹中的所有文件

```sh
mc ls --recursive myminio/mybucket/folder
```

列出文件夹中的所有文件,包括子文件夹

```sh
mc ls --recursive --include-folders myminio/mybucket/folder
```

### mc 其他操作

- 列出所有桶:`mc ls myminio`
- 显示帮助信息:`mc help`
- 版本信息:`mc version`
列出所有桶

```sh
mc ls myminio
```

显示帮助信息

```sh
mc help
```

版本信息

```sh
mc version
```

另见
---

### 扩展阅读
- [MinIO官方文档](https://min.io/docs/minio/kubernetes/upstream/)
- [MinIO github 源码](https://github.com/minio/minio)
- [MinIO官方文档](https://min.io/docs/minio/kubernetes/upstream/) _(min.io)_
- [MinIO github 源码](https://github.com/minio/minio) _(github.com)_

1 comment on commit 58efbde

@jaywcjlove
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.