日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > windows >内容正文

windows

fastdfs 吗 支持windows_主流开源文件存储系统-fastdfs是否支持windows?你可以选择minio...

發布時間:2023/12/10 windows 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 fastdfs 吗 支持windows_主流开源文件存储系统-fastdfs是否支持windows?你可以选择minio... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
首先答案是肯定的,fastdfs不支持windows。 其次建議你使用Minio

一、引言

一般來說文件存儲花錢就選擇阿里云oss、七牛云等產品,開源的話,目前開源的分布式文件存儲系統非常多,上網一搜 "Ceph,GlusterFS,Sheepdog,

Lustre,Swift,Cinder,TFS,HDFS,MooseFS,FastDFS,MogileFS等" 這么多,有沒有感覺看完對這些產品的分析后,還是不知道選擇哪個????

這是一篇針對主流的開源的分布式文件存儲系統的對比文章:

開源分布式存儲系統的對比_直到世界的盡頭-CSDN博客_四大開源分布式存儲?blog.csdn.net

二、那到底選擇哪個呢?

2.1、實在沒法選擇時,我們先看看幾開源產品github 的 star

分布式文件系統github staros支持
minio25.1kwin/linux
fastdfs7kwin
ceph8.6kwin/linux
GlusterFS2.9kwin/linux

2.2、推薦使用minio

看看這篇文章:《MinIO很強-讓我放棄FastDFS擁抱MinIO的8個理由》

MinIO很強-讓我放棄FastDFS擁抱MinIO的8個理由?www.cnblogs.com

三、minio安裝與使用

3.1、 windows安裝非常簡單

官網直接下載:

https://min.io/?min.io

啟動就這么簡單, F:Data 就是文件存儲的目錄

3.3、java調用minio

在官方上有相應的demo,不過官網引用的版本比較舊,相應的demo也比較舊,最新的demo我們可以去github上看。

githug examples:

https://github.com/minio/minio-java?github.com

minio/minio-java

https://github.com/minio/minio-java?github.com

以下代碼基于官方github微調后的示例

<dependency><groupId>io.minio</groupId><artifactId>minio</artifactId><version>8.0.3</version></dependency>class MinioTest {MinioClient minioClient;@BeforeEachvoid setUp() {minioClient =MinioClient.builder().endpoint("https://play.min.io").credentials("Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG").build();}/*** 上傳文件** @throws Exception*/@Testvoid test_upload() throws Exception {minioClient.uploadObject(UploadObjectArgs.builder().bucket("bucket01").object("test.txt").filename("D:dataDesktoptest.txt").build());System.out.println("my-filename is uploaded to my-objectname successfully");}/*** 下載文件** @throws Exception*/@Testvoid test_download() throws Exception {minioClient.downloadObject(DownloadObjectArgs.builder().bucket("bucket01").object("test.txt").filename("D:dataDesktoptest.txt").build());System.out.println("my-filename is uploaded to my-objectname successfully");}/*** 獲取文件URL** @throws Exception*/@Testvoid test_geturl() throws Exception {String url =minioClient.getPresignedObjectUrl(GetPresignedObjectUrlArgs.builder().method(Method.GET).bucket("bucket01").object("test.txt").expiry(60 * 60 * 24).build());System.out.println(url);}/*** 上傳+加密** @throws Exception*/@Testvoid test_upload_sse() throws Exception {KeyGenerator keyGen = KeyGenerator.getInstance("AES");keyGen.init(256);ServerSideEncryptionCustomerKey ssec =new ServerSideEncryptionCustomerKey(keyGen.generateKey());minioClient.uploadObject(UploadObjectArgs.builder().bucket("bucket01").object("test-sse-01.txt").filename("D:dataDesktoptest.txt").sse(ssec).build());System.out.println("my-filename is uploaded to my-objectname successfully");}/*** 下載+解密** @throws Exception*/@Testvoid test_download_sse() throws Exception {KeyGenerator keyGen = KeyGenerator.getInstance("AES");keyGen.init(256);ServerSideEncryptionCustomerKey ssec =new ServerSideEncryptionCustomerKey(keyGen.generateKey());minioClient.downloadObject(DownloadObjectArgs.builder().bucket("bucket01").object("test-sse-01.txt").filename("D:dataDesktop_test-sse-01.txt").ssec(ssec) // Replace with same SSE-C used at the time of upload..build());System.out.println("my-objectname is successfully downloaded to my-filename");}/*** 如何保存上傳時的密鑰對象** @throws Exception*/@Testvoid test_key() throws Exception {KeyGenerator keyGen = KeyGenerator.getInstance("AES");keyGen.init(256);SecretKey key1 = keyGen.generateKey();byte[] keySave = key1.getEncoded();System.out.println("key1 = " + Base64.getEncoder().encodeToString(keyBytes));//這里把keySave 保存下來就可以了,當然我們可以轉成base64保存//以下就是把存儲下來的keySave還原成SecretKey對象SecretKey key2 = new SecretKeySpec(keySave , "AES");System.out.println("key2 = " + Base64.getEncoder().encodeToString(key2 .getEncoded()));//key1 == key2assertEquals(key1,key2);} }

總結

以上是生活随笔為你收集整理的fastdfs 吗 支持windows_主流开源文件存储系统-fastdfs是否支持windows?你可以选择minio...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。