既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上软件测试知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新
1.1 Install the MinIO Server
# 指导安装方式
wget https://dl.min.io/server/minio/release/linux-arm64/archive/minio-20230804174021.0.0.aarch64.rpm -O minio.rpm
sudo dnf install minio.rpm
# 实际安装
rpm -ivh minio-20230804174021.0.0.x86_64.rpm
1.2 Launch the MinIO Server
# 指导启动方式
mkdir ~/minio
minio server ~/minio --console-address :9090
# 实际启动
mkdir -p /home/minio/data
minio server /home/minio/data --console-address tcloud:9090
[root@tcloud data]# minio server /home/minio/data --console-address tcloud:9090
WARNING: Detected Linux kernel version older than 4.0.0 release, there are some known potential performance problems with this kernel version. MinIO recommends a minimum of 4.x.x linux kernel version for best performance
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.
WARNING: Detected default credentials 'minioadmin:minioadmin', we recommend that you change these values with 'MINIO\_ROOT\_USER' and 'MINIO\_ROOT\_PASSWORD' environment variables
MinIO Object Storage Server
Copyright: 2015-2023 MinIO, Inc.
License: GNU AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html>
Version: RELEASE.2023-08-04T17-40-21Z (go1.19.12 linux/amd64)
Status: 1 Online, 0 Offline.
S3-API: http://172.17.0.8:9000 http://172.18.0.1:9000 http://172.81.0.1:9000 http://172.20.240.0:9000 http://127.0.0.1:9000
RootUser: minioadmin
RootPass: minioadmin
Console: http://tcloud:9090
RootUser: minioadmin
RootPass: minioadmin
Command-line: https://min.io/docs/minio/linux/reference/minio-mc.html#quickstart
$ mc alias set myminio http://172.17.0.8:9000 minioadmin minioadmin
Documentation: https://min.io/docs/minio/linux/index.html
Warning: The standard parity is set to 0. This can lead to data loss.
# 后台启动命令
nohup /usr/local/bin/minio server /home/minio/data --console-address tcloud:9090 > /home/minio/data/minio.log 2>&1 &
# 自定义账号密码后的启动
export MINIO\_ACCESS\_KEY=minio
export MINIO\_SECRET\_KEY=miniostorage
nohup /usr/local/bin/minio server /home/minio/data --console-address tcloud:9090 > /home/minio/data/minio.log 2>&1 &
1.3 Connect Your Browser to the MinIO Server
工作台详细使用文档 https://min.io/docs/minio/linux/administration/minio-console.html#minio-console
登录页面:
登录成功:
2.SpringBoot集成
Java Quickstart Guide https://min.io/docs/minio/linux/developers/java/minio-java.html#minio-java-quickstart
Java SDK https://github.com/minio/minio-java/tree/release
2.1 依赖及配置
<!--当前的最新版本-->
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
<version>8.5.5</version>
</dependency>
在Minio Console
上生成的两个 Key:
{
"accessKey": "SllF5SkIozb1n0b1D84M",
"api": "s3v4",
"path": "auto",
"secretKey": "ZQSiCm3UDST1Q5lL1sImpOUNKIQSv6qZGucB4ku0",
"url": "http://tcloud:9090/api/v1/service-account-credentials"
}
yml配置:
minio:
url: http://tcloud:9000
accessKey: SllF5SkIozb1n0b1D84M
secretKey: ZQSiCm3UDST1Q5lL1sImpOUNKIQSv6qZGucB4ku0
bucketName: tcloud-minio
2.2 代码
Minio配置类:
@Configuration
@ConfigurationProperties(prefix = "minio")
@Data
public class MinioConfig {
private String url;
private String accessKey;
private String secretKey;
private String bucketName;
}
Minio工具类:
@Slf4j
@Component
public class MinioUtil {
private MinioClient minioClient;
@Resource
private FileSystemConfig fileSystemConfig;
@Resource
private MinioConfig minioConfig;
private String bucketName;
@PostConstruct
private void connectToServer() {
if (fileSystemConfig.isMinioEnable()) {
// 初始化 MinioClient
minioClient = MinioClient.builder()
.endpoint(minioConfig.getUrl())
.credentials(minioConfig.getAccessKey(), minioConfig.getSecretKey())
.build();
// 检测 bucket 是否存在
bucketName = minioConfig.getBucketName();
bucketExists(bucketName);
}
}
/\*\*
\* 根据 bucketName 检测是否存在 不存在则创建
\*
\* @param bucketName 名称
\*/
![img](https://img-blog.csdnimg.cn/img_convert/2e95a708f47aa8e7528064609df97ef8.png)
![img](https://img-blog.csdnimg.cn/img_convert/34baaeca852d8fbd811e19e8263ae0c5.png)
![img](https://img-blog.csdnimg.cn/img_convert/a71eff73cb7226426f76124b9706bdba.png)
**既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上软件测试知识点,真正体系化!**
**由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新**
**[需要这份系统化的资料的朋友,可以戳这里获取](https://bbs.csdn.net/topics/618631832)**
-1715808426436)]
**既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上软件测试知识点,真正体系化!**
**由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新**
**[需要这份系统化的资料的朋友,可以戳这里获取](https://bbs.csdn.net/topics/618631832)**