当前位置:网站首页>Minio file system 8.0.3
Minio file system 8.0.3
2022-07-22 04:11:00 【jwolf2】
1. brief introduction
minio Name from the official website https://docs.min.io/ It can be seen that , It is also very useful min. Officially, it is the fastest object storage system in the world , Can replace Hadoop HDFS, It seems that there is no such thing here fastDFS What's the matter
2. install minio, final server /data Indicates the data storage directory , Here, map the directory to /home/data/minio Next , Data needs to be moved in or out from here copy that will do
docker run -p 8219:9000 --name minio -d --restart=always -e "MINIO_ACCESS_KEY=admin" -e "MINIO_SECRET_KEY=admin123456" -v /home/data/minio:/data -v /etc/minio/config:/root/.minio minio/minio server /data
3.API Examples of use , With seven niuyun api Is very similar , For more information, please refer to the official documents
public static void main(String[] args) throws IOException, InvalidKeyException, InvalidResponseException, InsufficientDataException, NoSuchAlgorithmException, ServerException, InternalException, XmlParserException, ErrorResponseException {
MinioClient client = MinioClient.builder()
.endpoint(HttpUrl.parse("http://xxxx:8219"))
.credentials("admin", "admin123456")
.build();
//file Upload
ObjectWriteResponse uploaWriteResponse = client.uploadObject(
UploadObjectArgs.builder()
.bucket("test2020")
.filename("D:\\test.jpg")
.object("1B.jpg")
.build());
System.out.println(uploaWriteResponse.headers());
// Stream upload (Controller receive MultipartFile)
MultipartFile file = null;
ObjectWriteResponse objectWriteResponse = client.putObject(
PutObjectArgs.builder()
.bucket("test2020")
.stream(file.getInputStream(), -1, 1024)
.object("1B.jpg")
.build());
System.out.println(uploaWriteResponse.headers());
// Get the link address with expiration time
String objectUrl = client.getPresignedObjectUrl(GetPresignedObjectUrlArgs.builder()
.bucket("test2020")
.object("1B.jpg")
.method(Method.GET)
.expiry(30, TimeUnit.SECONDS)
.build());
System.out.println(objectUrl);
// Download to local
client.downloadObject(DownloadObjectArgs.builder()
.bucket("test2020")
.object("1B.jpg")
.filename("mydownload.jpg")
.build());
// Download write HttpServletResponse
HttpServletResponse response = null;
GetObjectResponse getObjectResponse = client.getObject(GetObjectArgs.builder()
.bucket("test2020")
.object("1B.jpg")
.build());
response.setHeader("Content-Disposition", "attachment;filename=" + "mydownload.jpg");
response.setContentType("application/force-download");
response.setCharacterEncoding("UTF-8");
IOUtils.copy(getObjectResponse, response.getOutputStream());
}
4.web Console
边栏推荐
- 合并二叉树
- MysqlWorkBench性能分析工具--性能仪表盘
- 无锡对全市必胜客门店开展食品安全隐患大排查
- openfegin/restemplate微服务调用最佳实践总结
- 相对熵、信息熵和交叉熵
- Chapter III after class exercises 15-23
- Shell programming - functions
- 论文阅读:A Large-Scale Chinese Short-Text Conversation Dataset(CDial-GPT)
- LSTM的巅峰理解笔记
- 10 papers of ant security laboratory were included by ccf-a top meeting to explore the realization of AI credibility from the perspective of algorithm
猜你喜欢
无锡对全市必胜客门店开展食品安全隐患大排查
Thesis reading: ctrl: a conditional transformer language model for controllable generation
nexus管理页面上传jar,jar可以被正常拉取到项目,使用idea lifecycle的deploy发布的jar只能拉取到pom,401问题
Chapter III after class exercises 15-23
首发!这份字节大佬亲码算法面试大厂进阶宝典,让你轻松刷爆LeetCode!
Paper reading: a large scale Chinese short text conversation dataset (cdial GPT)
马斯克自称大脑上云,是科学还是骗术?
Vite package reported an error [rollup plugin dynamic import variables] unexpected token. It turned out that it was because of console log
判断是否完全二叉树
声学术语记录
随机推荐
【CCF CSP】201812-1小明上学
Xlnet learning: Research Summary
【CCF CSP】201709-1打酱油
[CCF CSP] 201503-1 image rotation
【黑马早报】苏宁张康阳败诉,被“追债”17亿;恒驰总裁称恒驰大卖已成定局;iPhone14ProMax镜头激凸严重;微信支持全屏输入...
CountDownLatch与CyclicBarrier基本原理及区别
判断是否平衡二叉树
Image text cross modal fine-grained semantic alignment confidence correction mechanism aaai2022
Acoustic terminology record
USB of gadget_ function
libpng error: iTXt: chunk data is too large error: PNG unsigned integer out of range
[dark horse morning post] Suning Zhang Kangyang lost the lawsuit and was "debt recovery" of 1.7 billion; The president of hengchi said that hengchi's big sale was a foregone conclusion; Iphone14promax
XLNet:运行机制及和Bert的异同比较——摘要总结
马斯克自称大脑上云,是科学还是骗术?
MysqlWorkBench性能分析工具--性能仪表盘
Shell编程基础及变量
使用sql批量修改MacOs照片应用(Photos)上的照片时间
无锡对全市必胜客门店开展食品安全隐患大排查
[CCF CSP] 2012-1 Xiao Ming goes to school
【CCF CSP】201612-1中间数